Forum Moderators: open
Setting "margin: 0 auto" on those block elements will center them correctly in standards-compliant browsers (the "0" sets the top and bottom margins, the "auto" sets the left and right margins).
IE does not understand margin:auto, so even though its usage is not W3C-compliant you'll need to keep the text-align:center on <body>. Additionally, IE has the annoying habit of applying the centering to the text in addition to the blocks, so you'll need to apply an additional text-align on the inline content if you want to change it to left-aligned again.
So if your styles were all inline, your markup might be
[...]
<body style="text-align:center">
<div style="margin:0 auto; text-align:left; width:80%; background:#ffc;>
<h1>Title</h1>
<p>Your content here.</p>
[...]
</div>
</body>
[...]