I am having some problems getting Internet Explorer v6 to interpret my site correctly. It works fantastic in IE7 and FireFox2, but IE6 isnt working right.
Here is the CSS:
@charset "utf-8";
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #999999;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 5px;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
.twoColHybLtHdr #container {
min-width:580px;
max-width:1240px;
width: 80%; /* this will create a container 80% of the browser width */
background: none;
margin: 15px auto 15px auto; /* the auto margins (in conjunction with a width) center the page */
text-align: left; /* this overrides the text-align: center on the body element. */
}
#header {
background: #DDDDDD;
padding: 0 10px; /* Padding may need to be removed when the image is placed */
margin: 0 0 15px 0;
}
#header h1 {margin: 0; padding: 10px 0;}
#footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
#footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
/* Miscellaneous classes for use in any situation */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
/*************************
**********
*/
/* ROUNDED CURVE CSS FOR THE MAIN CONTENT DIV */
/*************************
**********
*/
.roundedcorner_sidebox { /****** SideBarBox Div - Designates float and no Left/Right margin *******/
float:left;
background: url(../images/round/tl.png
) no-repeat top left;
margin: 15px 0 0 0;
padding: 0;
width:204px;
clear:both;
}
.roundedcorner_box { /****** MainContentBox Div - Cant float because there is no fixed width to prevent the div from dropping *******/
margin: 30px 0 0 225px;
background: url(../images/round/tl.png
) no-repeat top left;
}
.roundedcorner_content {/****** Creates 4px right edge *******/
background: url(../images/round/r.png)
top right repeat-y;
}
.roundedcorner_top div,.roundedcorner_top,
.roundedcorner_bottom div, .roundedcorner_bottom {
height: 14px;
font-size: 1px;
}
.roundedcorner_box p, .roundedcorner_sidebox p {padding: 0 10px 0 10px; }
.roundedcorner_top {background: url(../images/round/tr.png
) no-repeat top right;}
.roundedcorner_bottom {background: url(../images/round/bl.png
) no-repeat bottom left;}
.roundedcorner_bottom div {background: url(../images/round/br.png
) no-repeat bottom right;}
.roundedcorner_content, .roundedcorner_bottom {margin-top: -19px;}
/*************************
**********
*/
/* THE FOLLOWING DIVS ARE FOR THE CONTENT DIVS THEMSELVES, WHICH ARE CONTAINED WITHIN THE ROUNDED DIVS ABOVE */
/*************************
**********
*/
#mainContent {
margin:15px 4px 15px 4px;
background: #ffffff url(../images/background.g
if) top left no-repeat;
background-position: -220px 0;
}
#sidebar1 {
background: #ffffff url(../images/background.g
if) top left no-repeat;
margin: 15px 4px 15px 4px;
}
#sidebar2, sidebar3, sidebar4 {
margin: 0 0 15px 0;
padding: 5px;
background: #ffffff;
margin: 15px 4px 15px 4px;
}
#sidebar1 h3, #sidebar1 p, #mainContent h3, #mainContent p { margin-left: 10px; margin-right: 10px;}
Here is the HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="css/stylesheet.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColHybLtHdr #sidebar1 { padding-top: 30px; }
.twoColHybLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it may need to avoid several bugs */
</style>
<![endif]-->
</head>
<body class="twoColHybLtHdr">
<div id="container">
<div id="header">
<h1>Header</h1>
<!-- end #header -->
</div>
<!-- THIS IS THE LEFT NAV -->
<div class="roundedcorner_sideb
ox">
<div class="roundedcorner_top">
<div></div>
</div>
<div class="roundedcorner_conte
nt">
<div id="sidebar1">
<h3>sidebar1 Content</h3>
<p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if the #mainContent div will always contain more content than the #sidebar1 div. </p>
<!-- end #sidebar1 -->
</div>
</div>
<div class="roundedcorner_botto
m">
<div></div>
</div>
</div>
<div class="roundedcorner_sideb
ox">
<div class="roundedcorner_top">
<div></div>
</div>
<div class="roundedcorner_conte
nt">
<div id="sidebar2">
<h3>sidebar2 Content</h3>
<p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if the #mainContent div will always contain more content than the #sidebar1 div. </p>
<!-- end #sidebar1 -->
</div>
</div>
<div class="roundedcorner_botto
m">
<div></div>
</div>
</div>
<!-- THIS IS THE MAIN CONTENT -->
<div class="roundedcorner_box">
<div class="roundedcorner_top">
<div></div>
</div>
<div class="roundedcorner_conte
nt">
<div id="mainContent">
<h1> Main Content </h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id, libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p>
<h2>H2 level heading </h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
</div>
</div>
<div class="roundedcorner_botto
m">
<div> </div>
</div>
</div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
<br class="clearfloat" />
<div id="footer">
<p>Footer</p>
<!-- end #footer -->
</div>
<!-- end #container -->
</div>
</body>
</html>
If you want to try to recreate it, here are the images for the CSS corners
bl.png -
http://img234.imageshack.us/img234/4485/bldt7.pngbr.png -
http://img453.imageshack.us/img453/9897/brsp0.pngr.png -
http://img212.imageshack.us/img212/7316/57674055yt4.pngtl.png -
http://img102.imageshack.us/img102/5883/tlhl0.pngtr.png -
http://img105.imageshack.us/img105/4209/trlo4.pngbackground.gif -
http://img513.imageshack.us/img513/8840/backgroundaw8.gifIt should look like this in all browsers, but IE6 is hosed. I'm sure is a box model problem, but am totally lost:
http://img102.imageshack.us/img102/600/correctqu2.gifThis is what it looks like in IE6:
http://img164.imageshack.us/img164/7007/untitledzo2.pngThe DIV in question is the right hand one for the main content, not the lefthand sidebars.
Please help!
Start Free Trial