BillyRayPreachersSon
Programmer
I've been using a 3-column layout on a site we're building, but have only just noticed a problem in IE 6/Win (I've not tested it in other versions of IE/Win).
The following is a cut-down test harness showing the problem. It uses the HTML 4.01 transitional DOCTYPE, and validates with no errors.
If you look closely, you will see that running down the left-hand side of the main content area (#mainContent) is a small indent (it runs inside the coloured area, not outside of it). This height of this indent coincides with the height of the left-hand navigation.
My question is - how do I stop it from happening? I've tested this layout in some non-IE browsers:
NN/Mac, Fx/Mac, Safari/Mac, Opera 7, 7.54, 8/Win, NN7/Win, Fx 1.5/Win
and none exhibit this behaviour - only IE/Win. It's driving me loopy, as I just cannot seem to stop it.
Any help greatly appreciated!
Thanks,
Dan
[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
The following is a cut-down test harness showing the problem. It uses the HTML 4.01 transitional DOCTYPE, and validates with no errors.
If you look closely, you will see that running down the left-hand side of the main content area (#mainContent) is a small indent (it runs inside the coloured area, not outside of it). This height of this indent coincides with the height of the left-hand navigation.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<title>3-column test harness</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
/* Miscellaneous */
html, body {
padding: 0px;
margin: 0px;
}
html>body {
font-size: 16px; /* IE can't read this */
}
body {
background-color: #CDD5E0;
font-family: Arial, Helvetica, sans-serif;
font-size: 100%; /* For IE */
text-align: center; /* For IE 5.5 & 5.0 to centre the main display area - reverted in div#centreContent */
}
#centreContent {
text-align: left;
margin: auto;
width: 736px;
position: relative;
}
/* Left Navigation */
#leftNavigation {
font-size: 75%;
width: 136px;
float: left;
position: relative; /* Needed for IE to display this block at all! */
background-color: red;
}
/* Right Navigation */
#rightNavigation {
width: 163px;
float: right;
position: relative; /* Needed for IE to display this block at all! */
background-color: red;
}
/* Containers */
#contentOuter {
clear: left;
background-color: #FFFFFF;
padding: 0px 6px 6px 6px;
}
#content {
position: relative;
background-color: #FFFFFF;
margin-top: 6px;
}
/* Content */
#mainContent {
margin: 0px 186px 20px 153px;
background-color: gold;
}
#mainContent p {
margin: 0px 0px 10px 0px;
padding: 0px;
font-size: 0.8em;
}
/* Footer */
#footer {
background-color: red;
}
</style>
</head>
<body id="topOfPage">
<div id="centreContent">
<div id="contentOuter">
<div id="content">
<div id="leftNavigation">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi ut neque in nulla aliquet convallis. Morbi porta purus at arcu. Aliquam neque. Aliquam sapien. Nulla facilisis auctor eros. Cras justo. Fusce arcu elit, vulputate ut, suscipit vitae, aliquet vel, neque. Nulla est nibh, aliquam quis, euismod nec, fringilla nec, mauris.</p>
</div>
<div id="rightNavigation">
Right nav would go here
</div>
<div id="mainContent">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi ut neque in nulla aliquet convallis. Morbi porta purus at arcu. Aliquam neque. Aliquam sapien. Nulla facilisis auctor eros. Cras justo. Fusce arcu elit, vulputate ut, suscipit vitae, aliquet vel, neque. Nulla est nibh, aliquam quis, euismod nec, fringilla nec, mauris. Duis malesuada, tortor in tincidunt feugiat, turpis dolor porta est, in rhoncus nunc nulla nec velit. Aenean aliquet ante in elit. Etiam sed massa ac ipsum tristique adipiscing. Nunc semper purus sit amet nibh. Sed lectus. Donec elit velit, imperdiet eget, auctor in, consectetuer vel, massa. Suspendisse facilisis libero vel mauris.</p>
<p>In diam metus, dictum ac, molestie sit amet, placerat id, enim. Donec hendrerit felis non massa. Aenean turpis odio, ultricies eget, tempus ac, facilisis sit amet, nunc. Integer quis sapien. Fusce mollis augue id tellus dignissim scelerisque. Donec tellus lorem, pharetra sit amet, lacinia eget, condimentum ultricies, felis. Sed bibendum vestibulum mauris. Quisque enim urna, pulvinar nec, tincidunt sit amet, scelerisque nec, erat. Nulla facilisis enim ut orci. Suspendisse potenti. Sed aliquam felis suscipit orci posuere egestas.</p>
<p>Nam lobortis vestibulum arcu. Nullam ultricies lorem eget orci. Aenean malesuada. Cras eget mauris. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur eget eros ac orci sodales congue. Nullam auctor erat vel diam. Phasellus augue pede, viverra vitae, suscipit at, euismod ac, pede. Duis sollicitudin ornare pede. Ut suscipit. Donec mi quam, facilisis bibendum, consequat quis, ultrices a, erat. Nullam ac nisi vitae sem aliquam consequat. Duis eu neque. Aenean viverra imperdiet orci. Morbi ligula dui, dignissim vitae, fermentum a, iaculis sed, dui. Praesent eget felis. Morbi at justo eget ante auctor tincidunt. Aenean augue eros, interdum sed, aliquet non, tristique nec, nunc.</p>
</div>
<div id="footer">
A footer would go here
</div>
</div>
</div>
</div>
</body>
</html>
My question is - how do I stop it from happening? I've tested this layout in some non-IE browsers:
NN/Mac, Fx/Mac, Safari/Mac, Opera 7, 7.54, 8/Win, NN7/Win, Fx 1.5/Win
and none exhibit this behaviour - only IE/Win. It's driving me loopy, as I just cannot seem to stop it.
Any help greatly appreciated!
Thanks,
Dan
[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]