Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS probs 1

Status
Not open for further replies.

manicleek

Technical User
Jun 16, 2004
143
GB
I have a site using a css for the layout

It is a centre aligned site using the following code:

Code:
#grey-column
{
width:760px;
min-height: 100%;/* for moz and others*/
margin-left: auto;
margin-right: auto;
background-color: #cccccc;
background-image:url(/site_images/bodyback3.jpg);
}

This looks fine in ie6 and firefox but on ie5 it is aligned to the left, can anyone tell me why?
 
IE5 does not support the margin: auto thing because it is old, outdated and poorly supports the standards. If you want it centered in that browser, you need to embed it in another element that centers its text:
Code:
body 
{
  text-align: center;
}

#grey-column
{
  width:760px;
  min-height: 100%;/* for moz and others*/
  margin-left: auto;
  margin-right: auto;
  background-color: #cccccc;
  background-image:url(/site_images/bodyback3.jpg);
  text-align: left;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top