Auto Margins in IE7

Discussion in 'CSS' started by fireflyproject, May 10, 2007.

  1. #1
    Does anyone else have issues with these? This is my code

    #page {
    margin: 10px auto 10px auto;
    }
    Code (markup):
    It works fine and dandy in Firefox and Mac browsers, but not in IE7. It is left justified in IE7.

    Anyone have a fix for this? It's not the first time I've seen it either.
     
    fireflyproject, May 10, 2007 IP
  2. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Looks like IE7 would be fine with that, are you sure its not a child element thats causing the problem?
     
    bacanze, May 10, 2007 IP
  3. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #3
    I don't think so, I'll double check though.
     
    fireflyproject, May 10, 2007 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    If you fail to use a complete and proper DTD, IE6+ goes into quirks mode, where it doesn't grok {margin: 10px auto;}, the 'auto' part, that is. Trigger standards mode and all should be well.

    cheers,

    gary
     
    kk5st, May 10, 2007 IP
  5. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #5
    There's something wrong with your code then, it has to work.
     
    soulscratch, May 10, 2007 IP
  6. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #6
    A link to the page may be handy, as Gary said have you declared a DTD?
     
    bacanze, May 11, 2007 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I'm going to second the question about the DOCTYPE. Do you have a full and complete DOCTYPE? Are you using HTML or XHTML (albeit served as HTML with some syntatical errors)?
     
    Dan Schulz, May 13, 2007 IP