Home » Programming / Coding

margin-bottom not working in IE

3 December 2008 2,093 views 3 Comments

if you place a div with margin-bottom:20px; IE would not show the margin at all if you do not flush the div to the bottom of the document(when content filled).

#content {background-color:#000;font-size:1px;margin-left:0;margin-right:0;margin-top:50px;margin-bottom:20px; }

This is the css style for the div.

To flush the div to the bottom of the document, use this style as well:

body {margin-bottom:0;}

Guess what just this won’t work either.

.clear1 { height:1px;font-size:1px;padding:0;clear:left; }

Use <div class=”clear1″>&nbsp;</div> at the very end of the page.
That should do.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

3 Comments »

  • Busby SEO Test said:

    thanks for the info,,nice post its great!

  • Gary said:

    Wow! Worked great in both IE and FF. Thanks.

  • V1T said:

    Thanks!!! It is great, thank you very much.!!!!!

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.