In Internet Explorer, an empty block-level element can affect the display of the first line of text in the next block-level element. This bug is known to occur in IE6/Win. If you have seen it in other versions of IE, or can confirm it doesn’t occur, please contact me. The examples on this page all use <div>s, but work for any block-level element.
In Internet Explorer the first line of text in the <div> below appears on the background colour set for the previous <div>. This happens if the first <div> is empty and if the second <div> has its border set to something other than ‘none’. The height of the coloured area depends on the font size of the second <div>, and not of the first <div>.
<div style="background-color:#ccf;"></div>
<div style="border:solid;">
[...]
</div>
If you wrap the text in another <div> (shown in the second example, below), the background colour for the text disappears, but it still shows in gaps in the border (the border in the example is set to ‘dotted’, but appears solid at the top).
<div style="background-color:#000;"></div>
<div style="border:dotted;">
<div>
[...]
</div>
</div>
If you set a margin on the empty <div> (shown in the third example, below), the background colour for the first line of text also has this margin on the left and right. Note that the margin is relative to the outside of the <div>, ignoring borders.
<div style="background-color:#ccf;margin:4em;"></div>
<div style="border:0.5em solid;">
[...]
</div>
This bug isn’t particularly serious (don’t use empty block-level elements), but curious nevertheless.