You are not logged in.

#1 2010-06-06 14:00:46

gohu
Member
From: France
Registered: 2010-01-17
Posts: 36

Huge bottom padding of codeboxes

Hi,

When you put something inside code tags, the resulting block has a big bottom padding.

See how big the box is and how much space is lost under that line?

IMO, that discourages the use of the code block for a few lines of code because the block itself is ridiculously bigger than what's in it. That's unlucky because you frequently have to indicate shell commands that take just one or two lines.

The solution to correct this is easy and actually tidies things up:
In the html source, codeblocks are

<div class="codebox">
    <div class="incqbox">
        <h4>Code:</h4>
        <div class="scrollbox" style="height: 6em">
            <pre>CODECODECODE</pre>
        </div>
    </div>
</div>

You just have to delete the style attribute of the scrollbox div.

Then in the css, you add to the scrollbox the property

max-height: 40 em

(or whatever size you want for the max size of a codeblock before it starts becoming scrollable)

Offline

#2 2010-06-11 01:20:17

Pennyless
Member
Registered: 2010-06-06
Posts: 8

Re: Huge bottom padding of codeboxes

Why not just change the padding property in the CSS?

Offline

#3 2010-06-11 04:01:13

toxygen
Member
Registered: 2008-08-22
Posts: 713

Re: Huge bottom padding of codeboxes

this worked for me in a stylish css file i have:

div.scrollbox {
max-height:10em !important;
height:auto!important;
}

now it shows no extra empty lines!  the max-height:10 is my preference for when it scrolls as described above.

Last edited by toxygen (2010-06-11 04:02:10)


"I know what you're thinking, 'cause right now I'm thinking the same thing. Actually, I've been thinking it ever since I got here:
Why oh why didn't I take the BLUE pill?"

Offline

#4 2010-06-11 05:10:17

kazuo
Member
From: São Paulo/Brazil
Registered: 2008-03-18
Posts: 413
Website

Re: Huge bottom padding of codeboxes

But but, if we do this, our IE users dont gonna be happy tongue

Thanks for the info, that extra space bothered  me a lot. And its a general consensus (I'm right?) that style go into css and not into html.

But gohu, report this in the bug tracker, I think this the place for this suggestion (a patch is a bonus).

Offline

#5 2010-06-12 04:38:59

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Huge bottom padding of codeboxes

toxygen wrote:

this worked for me in a stylish css file i have:

div.scrollbox {
max-height:10em !important;
height:auto!important;
}

now it shows no extra empty lines!  the max-height:10 is my preference for when it scrolls as described above.

Nice. I added that to my generic css file.

Offline

Board footer

Powered by FluxBB