Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    San Francisco
    Posts
    455
    Thanks
    19
    Thanked 15 Times in 15 Posts

    Margin disappearing from H2 in IE

    Here are my h2 styles:
    Code:
    #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/
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read. Groucho Marx

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    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:

    Code:
    width:100%
    I dare say there's a few other solutions as well.

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Whenever you believe there is nothing wrong in your code and IE is truly misbehaving, then it'll most probably be a hasLayout issue.

    SB65's solution works there. Setting height:1%; to your #footer should also work.
    Last edited by abduraooft; 05-08-2009 at 10:46 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •