CSS Div
hi guys, i forgot how to align div to middle in my CSS,
for ex:
div.body
{
width: 800px;
}
and then...? what will be the next code to be aligned in center...
thanks...
hi guys, i forgot how to align div to middle in my CSS,
for ex:
div.body
{
width: 800px;
}
and then...? what will be the next code to be aligned in center...
thanks...
Renegade posted this at 18:19 — 29th August 2007.
He has: 3,022 posts
Joined: Oct 2002
Try this:
div.body {
width:800px;
margin:0 auto;
}
webwiz posted this at 19:01 — 29th August 2007.
He has: 629 posts
Joined: May 2007
... and if you want this to work in IE 5.5 (or IE 6/7 in quirks mode) add;
body {text-align: center;}
div.body {text-align: left;}
AveSatani_666 posted this at 01:31 — 30th August 2007.
He has: 21 posts
Joined: Aug 2007
thanks guys, im gonna try all your replies...
AveSatani_666 posted this at 01:41 — 30th August 2007.
He has: 21 posts
Joined: Aug 2007
great...! thanks for both of you Renegade and webwiz...
hope to learn from you more...
Renegade posted this at 19:48 — 30th August 2007.
He has: 3,022 posts
Joined: Oct 2002
No problem, glad it worked for you
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.