Posted By

charmcitycoder on 04/06/09


Tagged

css margin ie6 ie5 emptydiv


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

charmcitycoder
AshMan


IE6 Empty Div Adds Margin - Fix


 / Published in: CSS
 

URL: http://www.webdeveloper.com/forum/showthread.php?t=66024

For instances where you have an empty div that is less than about 10-15px in height. IE assumes it should contain something and allots room for text.

I first found this on the webdeveloper.com forums. The kicker here for me was the "font-size:0" declaration. Cheers!

  1. div{
  2. font-size:0;
  3. line-height:0;
  4. margin:0;
  5. padding:0;
  6. }

Report this snippet  

You need to login to post a comment.