Forum Moderators: open

Message Too Old, No Replies

Centered One-Column Layouts

What code do I need?

         

BabyKeys404

3:34 pm on Jul 12, 2006 (gmt 0)

10+ Year Member



Can any of you help me get the html code for a centered one-column layout?

Fotiman

9:14 pm on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<body>
<div id="container">
...
</div>
</body>

In this example, the div with the id of "container" is what we want to make centered and fixed width. Now for the CSS:

body
{
margin: 0;
padding: 0;
text-align: center;
}

#container
{
margin: 0 auto;
width: 770px;
border: 1px solid red;
}

The border is simply to show you where the edges of container are located.

[edited by: Fotiman at 9:15 pm (utc) on July 12, 2006]