I can't get this css code to center in IE. And it is pushing the last div tag further down than it should. Any clues??
body {
font: medium arial, sans-serif;
background-image: url(/images/bg.gif);
}
#container {
height: 660px;
width: 770px;
margin: 0 auto;
padding: 0;
}
h1 {
text-align: center;
margin: 0;
padding: 10px;
}
#left {
float: left;
font-size: small;
width: 374px;
padding-top: 0;
height: 372;
background-image: url(/images/travel_02.gif);
background-repeat: no-repeat;
background-position: right top;
margin: 0px;
padding: 0px;
}
#right {
float: left;
font-size: small;
height: 372;
width: 396px;
background-image: url(/images/travel_03.gif);
background-repeat: no-repeat;
background-position: left top;
margin: 0px;
padding: 0px;
}
#bottomone {
width: 770px;
float: left;
margin: 0px;
padding: 0px;
height: 140;
background-repeat: no-repeat;
background-position: center top;
}
#bottomtwo {
width: 770px;
float: left;
margin: 0px;
padding: 0px;
background-image: url(/images/travel_06.gif);
height: 140;
background-repeat: no-repeat;
background-position: center top;
}Hard to say without a link but have you tried text-align:center in the body style?I have never had any luck getting IE5.5 to center an element, <div> or <table>, without using the <center> tag. I know it is deprecated, but so should be IE5.5...awesome!! Thanks, now I just have to figure out why the bottom div is sitting so low.
CheersCan you post up the whole page with HTML so I can see how the layout is supposed to look? Or a link to a page?I have never had any luck getting IE5.5 to center an element, <div> or <table>, without using the <center> tag. I know it is deprecated, but so should be IE5.5...That's why you set text-align:center on the container of the element you want centered for old IE. It's the modren replacement for <center>.I'm referring to when the element is within nothing other than the <body>. Putting "text-align:center" an part of the body definition has never had any affect in IE 5.5 and, since a significant portion of the hits on my site use that browser, I need to accommodate it.
Using a <div> defined at "width:100%" and with "text-align:center" then another <div> within it does work, but that cannot always reasonably be done. When not, the <center> tag becomes unavoidable. So far as I know, browsers which cannot render it will ignore it.
body {
font: medium arial, sans-serif;
background-image: url(/images/bg.gif);
}
#container {
height: 660px;
width: 770px;
margin: 0 auto;
padding: 0;
}
h1 {
text-align: center;
margin: 0;
padding: 10px;
}
#left {
float: left;
font-size: small;
width: 374px;
padding-top: 0;
height: 372;
background-image: url(/images/travel_02.gif);
background-repeat: no-repeat;
background-position: right top;
margin: 0px;
padding: 0px;
}
#right {
float: left;
font-size: small;
height: 372;
width: 396px;
background-image: url(/images/travel_03.gif);
background-repeat: no-repeat;
background-position: left top;
margin: 0px;
padding: 0px;
}
#bottomone {
width: 770px;
float: left;
margin: 0px;
padding: 0px;
height: 140;
background-repeat: no-repeat;
background-position: center top;
}
#bottomtwo {
width: 770px;
float: left;
margin: 0px;
padding: 0px;
background-image: url(/images/travel_06.gif);
height: 140;
background-repeat: no-repeat;
background-position: center top;
}Hard to say without a link but have you tried text-align:center in the body style?I have never had any luck getting IE5.5 to center an element, <div> or <table>, without using the <center> tag. I know it is deprecated, but so should be IE5.5...awesome!! Thanks, now I just have to figure out why the bottom div is sitting so low.
CheersCan you post up the whole page with HTML so I can see how the layout is supposed to look? Or a link to a page?I have never had any luck getting IE5.5 to center an element, <div> or <table>, without using the <center> tag. I know it is deprecated, but so should be IE5.5...That's why you set text-align:center on the container of the element you want centered for old IE. It's the modren replacement for <center>.I'm referring to when the element is within nothing other than the <body>. Putting "text-align:center" an part of the body definition has never had any affect in IE 5.5 and, since a significant portion of the hits on my site use that browser, I need to accommodate it.
Using a <div> defined at "width:100%" and with "text-align:center" then another <div> within it does work, but that cannot always reasonably be done. When not, the <center> tag becomes unavoidable. So far as I know, browsers which cannot render it will ignore it.