Demonstration of IE6 Empty Div Bug

IE Empty Div Bug

This bug causes completely empty divs to have a minimum height of 20px

The code contains something like this: <div></div>

You will only witness the bug in IE6. The photo to the right shows what it looks like.

Jan 13, 2009 note: the Google JS code does NOT fix this bug. see test

The red div is set to 5px high, but displays 20px high in IE6, even though it is completely empty



The blue div is exactly the same, except it contains a comment inside the div "<!-- IE Sucks -->".
That is enough to squash the bug



The green div contains an empty paragraph inside an empty div. That squashes the bug too.

Return to tightCSS Home Page