how to center a site without using the <center> element (depreciated)?

I would like my site to be centered when requested. So, regardless of the user's monitor size, the site is always in the center.

I tried using the HTML element <center>; it does work; but it breaks some part of the site.

Given the example below, what would you add to the CSS or HTML to display it in the center of the page?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">
#container { width: 750px; }
#navigation { width: 100%; height: 1em; float: left; }
#navigation li { display: inline; }
#navigation li a { padding: .25em 1em; float: left;}
#main { width: 500px; float: left; }
#subsection { width: 200px; float: right; }
<div id="container">
<ul id="navigation">
<li><a href="">Home</a></li>
<li><a href="">About</a></li>
<li><a href="">Stuff</a></li>
<div id="main">
<p>Duis aute irure dolor ullamco laboris nisi in reprehenderit in voluptate.
Ut labore et dolore magna aliqua. .</p>
<p>Sunt in culpa velit esse cillum dolore qui officia deserunt. Eu fugiat
pariatur. Excepteur sint occaecat lorem ipsum dolor sit amet, sunt in culpa.
Velit esse cillum dolore quis nostrud exercitation duis aute irure dolor.
Ut enim ad minim veniam, excepteur sint occaecat sunt in culpa.</p>
<p>In reprehenderit in voluptate. Quis nostrud exercitation ut labore
et dolore
magna aliqua. Excepteur sint occaecat lorem ipsum dolor sit amet, cupidatat
non proident. Qui officia deserunt quis nostrud exercitation velit esse cillum
dolore. In reprehenderit in voluptate ut aliquip ex ea commodo consequat.</p>
<div id="subsection">
<p>Omnis dolor repellendus. Et quasi architecto beatae vitae consectetur,

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

body align="center"
or css body { text-align:center; }
should work
several options using div tags:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mark StegglesWeb DeveloperCommented:

The correct way is to use auto margins like so:

#container {
margin:0px auto;
width: 750px

epifanio67Author Commented:
the link gave me the clues.... got the answer... thx

margin: auto

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.