Forums

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

Home Forums CSS IE7 : Can’t Center web page

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #23415
    ScottMacD
    Member

    Hey everyone, right im creating a simple html site for a task ive been given.
    The web page has a width of 800px.

    ive wraped everything in a div:

    <div id="wrap">
    All content from page
    </div>

    in the css i’ve used the margin: 0 auto; trick that chris has shown in some of his screencasts.

    div#wrap {
    width:800px;
    height: 100%;
    margin: 0 auto;
    }

    The webpage is centered perfectly in Firefox 2 and 3 and Safari but i cant get it to center in IE 7.

    Can anyone help?

    #50620
    Argeaux
    Participant

    i tried the exact same code as you posted here and it worked.

    So i think there is something else wrong with your file…

    Code:




    Untitled Document


    All content from page


    #50625
    ScottMacD
    Member

    Hmm i’ve checked it all and it seems fine.

    it works ok in safari and firefox, just not IE 7 for some reason, ill get someone else to have a look over it.

    #50626
    ScottMacD
    Member

    I feel so stupid, i just compared it to another web page, i had a typo in my DOCTYPE. :roll:

    I still feel like blaming IE :lol:

    #50627
    soap
    Participant

    Good thing to do for older versions of IE is put text-align:center in body, html. Then just declare text-align left in your #wrap or whatever.

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