Positioning off in IE

Discussion in 'CSS' started by bschneider5, Jul 29, 2006.

  1. #1
    I'm trying to center my wrapper div, it works in Firefox fine but IE the whole things hangs on the right site. You can see it here-
    www.blog-hints.com

    THis is what my CSS tag looks like now

    div.wrapper{
        background-color: #FFFFFF;
        width:790;
        position: static;
        margin: 0 auto;
        }
    
    Code (markup):
     
    bschneider5, Jul 29, 2006 IP
  2. bschneider5

    bschneider5 Active Member

    Messages:
    1,009
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    88
    #2
    Never mind, I figured it out. I simply added this
    
        
    body {
        text-align: center;
        }
    
    Code (markup):
     
    bschneider5, Jul 29, 2006 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    The root cause of your centering problem is that you didn't use a full and complete DTD, causing IE to be in quirks mode. In quirks, IE6 does not support margin: auto. Fix the DTD, and you can drop the hack.

    You can use the hackish work-around for IE5, if you care about that two generations obsolete browser.

    cheers,

    gary
     
    kk5st, Jul 29, 2006 IP