And if the browser window is less than 700 pixels wide? Do you want to
the div to still be centered?
if you do
text-align: center;
in the body class, you can. Thats the only way I know of.
That only works in buggy browsers. Good browsers would center the
contents of the div within the div but leave the div itself in its
default left alignment.
The standard compliant way would be to apply margin-left: auto; and
margin-right: auto; to the div to be centered. This will work in
Gecko, Opera, IE5 Mac and IE6 Win (assuming Standards mode is
triggered by an appropriate Doctype). To make it work in IE5 we do
indeed need to add text-align center to the div's parent element, but
we then need to add text-align: left; to the div itself in order to
keep the text within the div left aligned in browsers that actually
properly understand basic CSS.
Steve