Cant get my design to center

Discussion in 'CSS' started by Nima, Oct 5, 2008.

  1. #1
    Im trying to center my website, but can't

    Here is the css im using:
    
    
    body {
    
    	margin: 0 auto;
    	padding: 0;
    	font-size: 12px;
    	background-color: #000000;
    	font-family:verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
    }
    
    
    Code (markup):
    does anyone have any idea why it is not working?

    Thanks
     
    Nima, Oct 5, 2008 IP
  2. steve875

    steve875 Peon

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    "body" = things like your global font, and background, not for centering your website.

    You're going to want to do something like this
    
    <div id="header"></div>
    
    <div id="page-wrap">
      This is where all your body content goes. 
    </div>
    
    <div id="footer"></div>
    
    Code (markup):
    Then you'll want your style to look something like this:

    
    #header { margin: 0 auto; }
    #page-wrap { margin: 0 auto; }
    #footer { margin: 0 auto; }
    
    Code (markup):
    Hope that helps
     
    steve875, Oct 5, 2008 IP
    Nima likes this.
  3. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #3
    thanks, it worked :)
     
    Nima, Oct 5, 2008 IP