tags:

views:

48

answers:

3

Hello people, I want to insert this margin, but I don't know why... I want it to be like Twitter or TwitPic

My CSS:

 body {
        margin: 40px;
        margin-bottom: 50px;
        padding: 0;
        background-color: #edece9;
        font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
        font-size: 13px;
        color: #333;
      }
A: 

twitter uses a fixed-width div which uses margin-left:auto; and margin-right:auto. this will center the div horizontally

knittl
A: 

you need to put a div with a fixed with (your desired page width and put its margin:0 auto

Gregoire
+1  A: 

Assuming a page structure like so:

<!DOCTYPE html>
<html>
  <head>
    <link type="text/css" rel="stylesheet" href="style.css" />
  </head>
  <body>
    <div id="main">
    </div>
  </body>
</html>

Then style.css should look like:

* {margin:0;}
div#main {
  width:800px;
  margin:0 auto;
}
jakemcgraw