Take the 2-minute tour ×

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


 body {
        margin: 40px;
        margin-bottom: 50px;
        padding: 0;
        background-color: #edece9;
        font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
        font-size: 13px;
        color: #333;
share|improve this question
the code you pasted could not be understood, use code tags –  Xinus Oct 26 '09 at 14:48
add comment

3 Answers

up vote 1 down vote accepted

Assuming a page structure like so:

<!DOCTYPE html>
    <div id="main">

Then style.css should look like:

* {margin:0;}
div#main {
  margin:0 auto;
share|improve this answer
add comment

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

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer


