Previous Message
Next Message

IE div height problem

Sent by Bruno Fassino on 8 June 2004 10:10

Curtis Clark wrote:

> The following, as the only content in a file, is the requested 10px high
> in Moz and Opera, but 20px high in IE 6.0 and IE 5.0:
> <div style="background-color: #CCCCCC; height: 10px;"></div>
> Any height 20px or greater is
> rendered correctly; any height less than 20px is rendered as 20px.

Yes, empty divs in IE/Win seem to have a minimum height, more or less equal
to the current line-height.
There is a couple of ways to solve this:
1) Put a comment inside the div:  <div style="height: 10px;"><!-- --></div>
2) Put a &nbsp; inside the div and add this to its style:  font-size:1px;

I tested these some time ago, if I remember well both methods work fine
without adversely affecting other browsers. Let me know if you see something


css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: