Log in

View Full Version : About center alignment in Ie



mikee.jk
02-27-2008, 12:41 PM
Hi guys

i am having a problem with center alignment .
it works fine in mozilla firefox but not in Ie?



Code:


<html>
<link rel="stylesheet" href="style.css">
<body>
<div id="container">

<div id="layout">

<div id="header">
mike
</div>

</div>

</div>
</body>
</html>




Code:

*{
margin:0;
padding:0;
}

#container{
width:100%;
background-color:#dfd;
height:100%;
}


#layout{
width:800px;
background-color:#fc9;
margin:0px auto;
}

#header{
width:800px;
background-color:#ddd;
height:150px;
}

Nile
02-27-2008, 01:10 PM
Maybe this?:

*{
margin:0;
padding:0;
}

#container{
width:100%;
background-color:#dfd;
height:100%;
}


#layout{
width:800px;
background-color:#fc9;
margin:0px auto;
}

#header{
width:800px;
background-color:#ddd;
height:150px;
text-align: center;
}

boogyman
02-27-2008, 02:45 PM
IE version 6 and below has very very little support for CSS.
try to apply the centering to the body element



body {
margin: 0 auto;
width: 760px;
text-align: center;
background: #(light_green_hexadecimal)
}
#container {
text-align: left;
}