views:

112

answers:

2
 <div id="spacer">

 </div>

+

#spacer {
    height: 4px;
}

Firefox and Safari do it right, the space on screen is small. IE8 makes it bigger than 4px. WTF.

If I set it to 200 pixels or whatever, the space is huge. It decreases until I get to around 15 px, at which point IE continues to draw a 15ish px space despite the css saying 4px.

Thanks so much if you can help me.

+1  A: 

You're almost certainly running into the line-height and/or font-size properties. Try decreasing those and the space should shrink.

#spacer {
    height: 4px;
    line-height:4px;
    font-size:4px
}
Gabriel Hurley
:) line-height: 0px; font-size: 0px; = fixed.Amazing. WHY would IE go to those properties if there isn't any text in the div?
cksubs
A: 

awesome. That is exactly what I needed. Thanks!

benpcampbell