Need Help With IE Condtional Statement For IE

Discussion in 'CSS' started by Swordfish, Mar 7, 2007.

  1. #1
    I have a page that is not centering in IE and is fine in Firefox.

    I believe the solution is too create a conditional statement for IE and create a new css for that div that isnt centering?

    Please PM for llink if you can help and I can pay via paypal....
     
    Swordfish, Mar 7, 2007 IP
  2. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I dont want paying or anything, but I would be happy to take a look for you :)
     
    bacanze, Mar 7, 2007 IP
  3. Swordfish

    Swordfish Active Member

    Messages:
    988
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #3
    Thanks, I've PM'd you the info.
     
    Swordfish, Mar 7, 2007 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    You have this,
    
    <!-- SELECT count(*) as StateCount   FROM reports as r   WHERE r.Active = 1     AND r.PageUrl <> ''     AND r.CountryAbbreviation = 'US'     AND r.StateAbbreviation = 'LA' -->
    Code (markup):
    preceding your DTD. Get rid of it. It triggers quirks mode in IE, and in quirks mode, IE does not grok {margin: auto;}.

    A better title on your post would have been a Good Thing®. Suggestion: "Unable to center page using margin auto in IE".

    The value of a forum like this is that problems and solutions are shared. Communicating via PM is anathema to that goal. Put everything in the open for all to benefit.

    cheers,

    gary
     
    kk5st, Mar 7, 2007 IP
  5. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sorry I wasnt able to post solution easier, I was at college, anyway kk5st is right.

    Anything above a doctype will throw IE6 into quirks mode and in quirks mode it does not understand auto margins.

    If that code has to stay in place then you would need to use the centring method that is needed for ie5.+ and that would be to use text-align:center on the body and then set text-align:left on #wrapper to re-set it.

    Code:

    body{text-align:center}
    #wrapper{text-align:left;}

    Lookup centering on google or something, if will be explained in detail there.
     
    bacanze, Mar 7, 2007 IP
  6. Swordfish

    Swordfish Active Member

    Messages:
    988
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #6
    Awesome. thanks for the help.
     
    Swordfish, Mar 7, 2007 IP