Posts Tagged ‘tables’
May
7, 2008
Centering a DIV with CSS
by Dusty,
at 12:14 pm
One of the biggest questions most people have when switching from the old-school tables way of coding a website, to the more-progressive CSS way of doing things is this: how do I center my website, using just CSS?
The answer is actually quite easy.
Simply add the following code to the main BODY class in your css document. An example would look like this:
BODY { 900px; margin: 0 auto; }
In the above example, you are defining the width of your live area by stating 900px. This width is whatever the width you want your content to be.
The margin: 0 auto clause centers the content wrapper in the browser, centering all your content within it, yet still allow
...
read more
read more