Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS IE 7 Centering

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25014
    zanuka
    Member

    trying to center my page layout in IE 7.

    works fine in Safari, Firefox, Opera with the following :

    body {
    margin: 0 auto;
    min-width: 990px;
    width: 990px;
    background: #000000 url(../images/bg.jpg);
    background-position: 50% 0;
    background-repeat: repeat-y;
    padding:0;
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size: 13px;
    }

    but I can’t seem to get it to center properly in IE 6/7

    any ideas?

    cheers,

    zanuka

    #58418
    AshtonSanders
    Participant

    Add

    Code:
    html { text-align:center;}

    You need that on your parent element to get margin: 0 auto; to work in IE.

    Then you need "text-align:left;" on your <body> tag to make your text align left again.

    (Although, I would not use your body as your page outline, I would make a <div ID="container"> or something similar.)

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.