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: 2,944 posts
Joined: Oct 2002
Try this:
div.body {
width:800px;
margin:0 auto;
}
webwiz posted this at 19:01 — 29th August 2007.
He has: 343 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;}
Cordially, David
--
"Old web developers don't die, they degrade gracefully..."
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: 2,944 posts
Joined: Oct 2002
No problem, glad it worked for you