Previous Message
Next Message

Centre a Div

Sent by Thierry Koblentz on 26 March 2006 03:03

Joanne wrote:
> I'm just reading a tutorial that tells me to:
> "Wrap the whole page in a centering, relatively positioned <div>,"
> I have the code for the relative position, but I don't know how to
> center the div.
> <div id="everything"></div>
> #everything{
> position: relative;}

Try this:

body {text-align:center}

position: relative;
margin:0 auto;

The text-align property is for IE 5 (and 6 in Quirks mode)

Thierry |
css-discuss [EMAIL-REMOVED]]
IE7b2 testing hub --
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: