help - wont center in IE

Discussion in 'HTML & Website Design' started by animateddesigns, Jan 17, 2009.

  1. #1
    hello all

    can anybody tell me where i am going wrong?

    http://oilpriceupdates.com/

    i want the content centered in IE like it does in netscape. have i missed a div?
    also the orange border stops too short on netsacpe.

    i thankyou for you time and would be grateful for any suggestions.
     
    animateddesigns, Jan 17, 2009 IP
  2. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Im not sure what is the problem because I see the content centered in IE6 and IE7

    But, I see you dont have a DOCTYPE specified at the beginning, this is often a reason why content wont centered with a margin: auto; css
     
    Camay123, Jan 17, 2009 IP
  3. katendarcy

    katendarcy Peon

    Messages:
    115
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Are you talking about IE6? I haven't looked on that yet, but IE7 is centered. I'll take a quick look.

    (And, make sure you have a doctype set, so the browser will know how to render it.)

    - EDIT: Oops - Just saw Camay123's post - Sorry!
     
    katendarcy, Jan 17, 2009 IP
  4. animateddesigns

    animateddesigns Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hello thanks for the prompt replies. dead impressed.

    the 'wrapper' is centered in IE and netscape. it is the content in the wrapper(news boxes, google adverts), they are offside to the left in IE.

    thanks.
     
    animateddesigns, Jan 17, 2009 IP
  5. elias_sorensen

    elias_sorensen Well-Known Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #5
    You shouldn't use <center> to center the page. It's an outdated tag.

    Instead, do this in your CSS-file:
    body {
    text-align: center;
    }

    and then the div you want centered:
    <div style="margin-left:auto;margin-right:auto;width:800px;">
    content
    </div>

    That's the most common way to do it these days :)
     
    elias_sorensen, Jan 17, 2009 IP
  6. Jaden-Ellett

    Jaden-Ellett Peon

    Messages:
    55
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    you can also do <div align="center"> tag at the beggining at the html page and then the closing tag of course at the end.</div>
     
    Jaden-Ellett, Jan 20, 2009 IP
  7. elias_sorensen

    elias_sorensen Well-Known Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #7
    align="center" isn't in the xhtml standards.

    1: It would not complete validation
    2: Not all browsers might display it correctly
     
    elias_sorensen, Jan 21, 2009 IP