Forum Moderators: not2easy
Its no big deal, I just want to find out why.
Here is the CSS:
/* --- DIVS --- */
#wrap {
position: relative;
margin: 30px auto;
background: transparent;
width: 710px;
padding: 0;
}
#black {
position: relative;
background: #000;
padding: 5px;
margin: 0;
width: 710px; /* box model hack */
voice-family: "\"}\"";
voice-family:inherit;
width: 700px;
}
/* Be nice to opera */
html>body #black {
width: 700px;
}
#top {
position: relative;
background: transparent url("../img/top.jpg") no-repeat;
height: 130px;
padding: 0;
margin: 0 0 5px 0;
}
#subtop {
position: relative;
background: transparent url("../img/topgreen.gif") no-repeat top right;
height: 25px;
padding: 0;
margin: 0;
}
#main {
position: relative;
background: #edb url("../img/bg_body.jpg") repeat-y;
width: 700px;
/* padding hack for mozilla */
padding: 0;
padding-top: 1px;
padding-bottom: 1px;
}
#maincontent {
float: left;
margin: 0;
padding: 30px 0 30px 30px;
width: 470px; /* box model hack */
voice-family: "\"}\"";
voice-family:inherit;
width: 440px;
}
html>#maincontent {
width: 440px;
}
#sidebar {
padding: 0;
margin: 0 0 10px 520px;
background: transparent;
width: 160px;
/* compensates for IE Win bungling */
height: 100%;
}
#bottom {
margin: 0;
padding: 0;
position: relative;
height: 10px;
display: block;
background: transparent url("../img/bg_bottom.jpg") no-repeat;
}
#footer {
margin: 0 0 0 0;
padding: 10px 0 20px 0;
position: relative;
background: transparent;
text-align: center;
} HTML:
<div id="wrap">
<div id="black">
<div id="top"></div>
<div id="subtop"></div>
<div id="main">
<div id="maincontent"></div>
<div id="sidebar"></div>
<div style="clear: both;"></div>
</div>
<div id="bottom"></div>
</div>
<div id="footer"></div>
</div>
In fact, I measured a screenshot and IE seems to have it set at 19px.
Now you know what it is, perhaps this 'effect' isn't relevant once you start filling with content?
I did these little tests using XHTML Strict doctype with no XML prologue...
The 'black div' is #bottom. IE is giving it more height than, in my case, firebird. I'm not sure why, but it seems that 10px high in one is different than in the other!
I dont quite understand, sorry. The #bottom div is positioned in the #black div, which is positioned in the #wrap div. Do you mean that the #bottom div is stretching to 19px, making the #black div and the #wrap div stretch_?
You specify 'display:block' in the declarations for #bottom; there is no need for this as a div is a block level element.
I know i dont need to make the #bottom div a block-level element, it was just a blind shot to see how IE reacted. Of course it made no difference...
By adding this "body{text-align:center}" to your styles and this "text-align:left" to #wrap your layout will center in IE, just like it does for me now in Firebird.
The layout does center in IE, at least the versions I tested (IE6/win and IE5/mac), so that is not an issue here.
Now you know what it is, perhaps this 'effect' isn't relevant once you start filling with content?
The effect isnt that relevant, but its still there no matter how much content I put in. I just wanted to know if somebody had a explanation to why the div is stretching in IE/win___
Thanx for your answer and efforts.
in this case it is actually the #bottom div as Mipapage says, which is causing this..
#bottom {
margin: 0;
padding: 0;
position: relative;
height: 10px;
display: block;
background: transparent url("../img/bg_bottom.jpg") no-repeat;
}
You've specified a height of 10px on it, IE however defaults to height 16px (line height 19px) and in order to override that you need to specify a small font size and line height too..
so font-size: 1px; line-height: 1px; added to this should bring IE back in line with the others..
Suzy
check the real url and see if the site does center in IE5/5.5 as I have no possibility to test it on my own.
Read How to: Install multiple versions of IE on your PC [webmasterworld.com] by DrDoc.