Jump to content
MakeWebGames

Code boxes to large


Recommended Posts

Well, I like to go trough posts and read the scripts people post - it's an annoying habit.

But there's one thing wrong with the whole thing; the code boxes are to large. They take up very much space and I have to scroll forever to get anywhere.

I suggest setting the code boxes to a height of 500 pixels, it would render pages much more visually better.

My only current solution is javascript, modifying the stylesheet rules to acquire the result I want.

If anyone want a quick solution too: make a button with the url as:

javascript:document.styleSheets[1].cssRules[474].style.cssText = "max-height:500px;overflow-y:scroll;";void(0);

That small little piece of script will set the height of any code boxes on the page to 500 pixels, AND... add a handy little scroll-bar.

Link to comment
Share on other sites

I agree on the subject of code boxes I do like one feature of SMF which would be great if you can get it for WBB;

using php tags [.php] you can use it just to give it the proper syntax rather than a full code box.

Example:

The PHP tags on here :

echo 'Hola';

SMF's version:

echo 'Hola';

I like that feature.

Link to comment
Share on other sites

...is this a browser thing? If the css has no height attribute for it, the smart thing for a browser to do is to fit the box to the size of its contents.

All the code boxes I see are just large enough to contain the code within it, ie. the code box in your first post is like 50 pixels high.

Why would you set it to 500px?

Link to comment
Share on other sites

Browsers default height property for div element is null, this is equal to 100%.

All of it's contents are displayed.

Also, I wonder if you ever hear about the "max-height" property? It's CSS 2 if I'm not wrong.

This means... if the height is more than 500 pixels, it's cut off. And to my ingenious thinking, I added an overflow property.

The overflow property defines what should be done with the contents that are cut off - I set it to scroll.

Link to comment
Share on other sites

I'm very familiar with css, thanks.

Sorry I misunderstood, your first post isn't very accurate. The code boxes are not 'too large', they are 'just the right size for the code'. What you want to do is reduce the box size, not (as I assumed) correct faulty css.

You suggested setting code boxes to 500px, not putting a limit on the height. I didn't look at the code you included, but now that I have, why would you only want overflow scrolling vertically? Why not have it horizontally as well, otherwise you'd be scrolling the entire screen as opposed to just the code box.

Link to comment
Share on other sites

As added..security? I guess....

Moderators aren't SET to remove posts immediately

If you have seen WBB from the admins point of view you can remove posts immediately

They can also change the access to allow moderators to be able to remove it immediately, it's just default set not to ;-)

 

it's also quite simple to adjust the code boxes via the admin panel as well.

Link to comment
Share on other sites

Guest Drizzle

Why not just set it to a reasonable height, 500px is fine, then use overflow:auto; or overflow:scroll; or w/e to scroll the boxes.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...