views:

43

answers:

2

I can't seem to get my <div> height in IE (7) to be shorter than 20px:

<div style="background: green; height: 1px;">

</div>

Using the above code (both with and without html and body tags) the height of the div cannot seem to drop below a certain value (I think it is 20px). Any ideas?

+3  A: 

Try adding overflow:hidden;.

Andy E
wow..that worked. thanks!
aeq
np. IE7 and lower can be funny with whitespace, line heights and font sizes - even though your div looks empty.
Andy E
@aeq: If that worked for you, show Andy some love and accept his answer.
Robusto
@Robusto: He needs to wait another 11 minutes before he can accept. Looking forward to the love, though ;-)
Andy E
+1  A: 

Andy E's head is right. You seem to have empty space inside the div that is rendered as a space, which happens to have 20px height. So either hide the overflow or remove the whitespace.

Evgeny Shadchnev