Skip navigation
Dlewis78
Currently Being Moderated

Why will my site not center?

May 10, 2012 9:15 PM

Tags: #not #site #centering

Hi there guys,

 

I have been having the toughest time centering my site.  I'm using DW CS4 and designed the site in Fireworks CS4.  I've tried all sorts of things including putting the entire body in a wrapper and trying to center it and I have still had no luck.  I'm at at wit's end. I'm still somewhat of a novice at this and not sure what I am doing wrong and would greatly appreciate your help.  Thanks! 

 

Website:

 

www.deaaralewis.com

 
Replies
  • Currently Being Moderated
    May 10, 2012 9:49 PM   in reply to Dlewis78

    Two things required to center your site: a wrapper with a defined width and left/right margins both set to auto.

     

    The way the site is coded at the moment, <div id="main"> is effectively acting as the wrapper.

     

    So change

     

    #main {

    width:800px;

    margin: 0px auto 0px 0px;

    border: 0px solid #f0f0f0;

    background-color: #522900;

    }

     

    to

     

    #main {

    width:800px;

    margin: 0px auto 0px auto;

    border: 0px solid #f0f0f0;

    background-color: #522900;

    }

     
    |
    Mark as:
  • Currently Being Moderated
    May 10, 2012 11:23 PM   in reply to Dlewis78

    And check the errors in your code:

     

    This one needs sorting:

     

    </style>

    </head>


    <div id="wrapper">


    <body>


    <div id="main">

     

    The <body> tag must come after the </head> tag.

     

    Martin

     

    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.deaaralew is.com%2F

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points