html + CSS. center div box in IE and firefox?

Soldato
Joined
4 Jan 2004
Posts
7,727
Location
Nottingham
hey guys, im tryin to center a div box in the middle of my page (horizontally only, not fussed on vertically), but what works for IE doesnt work for firefox and vice versa. also need ot to be centered no matter what the screen resolution is

can anyone help?

cheers :)
 
i had somethin similar to that to start with, just didnt have the margin: 0 auto bit in the body

though even after putting that it, it still doesnt work. well firefox is cetnered as it was before, but IE is still stuck to the left hand side??

this is the bit of my code:

got the body and the div box called Mainwrap. I've tried removing the width property (just makes my div box a little bit wider) but still doenst center it in IE??

Inside the div i have basically got a couple of tables full of text and a few pics etc

Code:
body
{
	background-color: #727272;
	margin: 0 auto;
	text-align: center;
}

div#Mainwrap
{
	margin: 0px auto;
	text-align: left;
	width: 1250px;

}
 
sorted it, just aligned the text in the div container to center instead of left, now its centered in both IE and firefox :)
 
Back
Top Bottom