main content not centering in ie 6

Associate
Joined
22 Aug 2010
Posts
2,212
Location
In My Command Center
ok i know ie 6 is old but this is bugging me, i have an <img> imbeded in my body tag which is centered but the container <div> will not center, does anyone have an idea why?

Capture-1.jpg


this is the css for it

/*----------- tag selectors ------------------*/

html {
background-color:#999;
}

body {
margin:0;
padding:0;
background:url(../_images/body_bg.jpg) repeat-y center top;
}

a {
text-decoration:none;
color:#fff;
}

p {
font-size:14px;
color:#fff;
text-transform:uppercase;
}

h1 {
text-transform:uppercase;
font-size:14px;
}

/*-------------- header ---------------*/

#container {
margin-left:auto;
margin-right:auto;
margin-top:50px;
margin-bottom:50px;
width:920px;
height:700px;
background-color:#333333;
}
 
body { text-align: center; }

then your main content container div

#container { text-align: left; }
 
The following is from memory, haven't got time to test.

Could just add the following instead:

body{
position:relative;
}

IE6 needs position:relative; to be on containers to center stuff using margin:auto;

Faffing with text-aligns is risky and bodgey IMO. Could be inherited by accident!

Can't test this on yours though, as I can't recreate the problem.
 
The following is from memory, haven't got time to test.

Could just add the following instead:

body{
position:relative;
}

IE6 needs position:relative; to be on containers to center stuff using margin:auto;

Faffing with text-aligns is risky and bodgey IMO. Could be inherited by accident!

Can't test this on yours though, as I can't recreate the problem.

no bother budy i will test it now and let you know how it goes, ty very much for your time ;)
 
The following is from memory, haven't got time to test.

Could just add the following instead:

body{
position:relative;
}

IE6 needs position:relative; to be on containers to center stuff using margin:auto;

Faffing with text-aligns is risky and bodgey IMO. Could be inherited by accident!

Can't test this on yours though, as I can't recreate the problem.

no position relative did not fix it :(
 
You may want to get a second opinion by running XP + IE6 in a VM.

IETester has some minor glitches that sometimes distort reality.
 
Back
Top Bottom