View Full Version : Margin disappearing from H2 in IE

05-07-2009, 08:51 PM
Here are my h2 styles:

#footer h2, #footer p {
margin-left: 325px;
width: 425px;
margin-bottom: 1em;
#footer h2 {
font-size: 12px;
text-transform: uppercase;
font-weight: normal;

I have run my code through both the HTML and CSS validators and they come out fine. Yet when you look at it on IE, the H2 text has no left margin. So in my document the word CONTACT is all the way to the left. Why?

Here is the link to the page: http://www.wmsalitdesign.com/staging/koltun/

05-08-2009, 10:58 AM
Looks like this is some sort of hasLayout bug in IE.

A possible fix might be to ensure your #footer does "haveLayout" (it doesn't at the moment) by adding:


I dare say there's a few other solutions as well.

05-08-2009, 11:44 AM
Whenever you believe there is nothing wrong in your code and IE is truly misbehaving, then it'll most probably be a hasLayout issue (http://www.satzansatz.de/cssd/onhavinglayout.html).

SB65's solution works there. Setting height:1%; to your #footer should also work.