Fumigator
10-28-2007, 03:03 AM
More CSS fun.
I used a layout (#31) from the Layout Gala (http://blog.html.it/layoutgala/) and it works fine, but when I try to center the top level <div> and add margins on left and right, IE6 messes up the left sidebar. (By messes up I mean it truncates the box on the left, and resizing the window causes the box to migrate across the window.) FF is fine with the change. I haven't tested any other browsers.
My question: Is there a way I can center the top level div (id="container") and keep IE6 from messing the left bar up?
Here is the page code, with the additional formatting added by me in red:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<title>Prototype</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
<style type="text/css">
html {
margin: 0;
padding: 0;
background: #ffffff;
color: #000;
}
body {
font: 76% verdana, tahoma, arial, sans-serif;
text-align:center;
margin: 0;
padding: 0;
background: #ffffff;
color: #000;
}
p {
margin: 0 10px 10px;
font-size: 1.15em;
letter-spacing: 0em;
word-spacing: 0em;
}
div#container {
width: 95%;
margin: 0 auto;
text-align: left;
background: #fff;
}
div#wrapper {
float: left;
width: 100%;
}
div#header {
height: 75px;
margin: 0;
padding: 0;
color: #fff;
font-family: "trebuchet MS", verdana, tahoma, sans-serif;
width: 100%;
float: left;
background: #33c url(img/header_bg1.jpg);
}
div#menudiv {
float: left;
width: 100%;
background: #fc6;
color: #000;
margin: 2px 0px 0px 0px;
padding: 0;
font-family: "trebuchet MS", Verdana, Arial, sans-serif;
}
div#fullcontent {
width: 99.8%;
border: 1px dotted #4c4c94;
float: left;
margin: 0 0 10px 0;
clear: both;
padding: 0;
background: #fff url(img/rightgrayfade.jpg) right repeat-y;
}
div#content {
margin-left:200px;
border: 1px dotted #4c4c94;
background: #fff url(img/rightgrayfade.jpg) right repeat-y;
padding 0 0 100px 0;
}
div#leftbar {
float:left;
border: 1px solid #4c4c94;
width:195px;
margin-left:-100%;
padding-bottom: 100px;
background: #d2d6e8;
}
div#footer {
background: #fff;
margin: 10px 0px 10px 0px;
color: #000;
clear: both;
width: 100%;
float: left;
font-size: .8em;
padding: 0px 0px 5px 0px;
border-top: 10px solid #eee;
border-bottom: 10px solid #eee;
}
div#footer p {
margin: 0;
padding: 5px 10px;
text-align: center;
}
.headtitle {
float: left;
display: inline;
text-align: center;
width: 100%;
}
.headtitle a {
color: #ffffc0 !important;
}
.headtitle h1 {
font-size: 3.1em;
font-weight: bold;
margin: 5px 0 5px 0;
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<div class="headtitle">
<h1>Troy Yates.com</h1>
</div>
</div>
<div id="wrapper">
<div id="content">
Ipsum Lorem.
</div>
</div>
<div id="leftbar">
Ipsum Lorem.
</div>
<div id="footer">
Ipsum Lorem.
</div>
</body>
</html>
I used a layout (#31) from the Layout Gala (http://blog.html.it/layoutgala/) and it works fine, but when I try to center the top level <div> and add margins on left and right, IE6 messes up the left sidebar. (By messes up I mean it truncates the box on the left, and resizing the window causes the box to migrate across the window.) FF is fine with the change. I haven't tested any other browsers.
My question: Is there a way I can center the top level div (id="container") and keep IE6 from messing the left bar up?
Here is the page code, with the additional formatting added by me in red:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<title>Prototype</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
<style type="text/css">
html {
margin: 0;
padding: 0;
background: #ffffff;
color: #000;
}
body {
font: 76% verdana, tahoma, arial, sans-serif;
text-align:center;
margin: 0;
padding: 0;
background: #ffffff;
color: #000;
}
p {
margin: 0 10px 10px;
font-size: 1.15em;
letter-spacing: 0em;
word-spacing: 0em;
}
div#container {
width: 95%;
margin: 0 auto;
text-align: left;
background: #fff;
}
div#wrapper {
float: left;
width: 100%;
}
div#header {
height: 75px;
margin: 0;
padding: 0;
color: #fff;
font-family: "trebuchet MS", verdana, tahoma, sans-serif;
width: 100%;
float: left;
background: #33c url(img/header_bg1.jpg);
}
div#menudiv {
float: left;
width: 100%;
background: #fc6;
color: #000;
margin: 2px 0px 0px 0px;
padding: 0;
font-family: "trebuchet MS", Verdana, Arial, sans-serif;
}
div#fullcontent {
width: 99.8%;
border: 1px dotted #4c4c94;
float: left;
margin: 0 0 10px 0;
clear: both;
padding: 0;
background: #fff url(img/rightgrayfade.jpg) right repeat-y;
}
div#content {
margin-left:200px;
border: 1px dotted #4c4c94;
background: #fff url(img/rightgrayfade.jpg) right repeat-y;
padding 0 0 100px 0;
}
div#leftbar {
float:left;
border: 1px solid #4c4c94;
width:195px;
margin-left:-100%;
padding-bottom: 100px;
background: #d2d6e8;
}
div#footer {
background: #fff;
margin: 10px 0px 10px 0px;
color: #000;
clear: both;
width: 100%;
float: left;
font-size: .8em;
padding: 0px 0px 5px 0px;
border-top: 10px solid #eee;
border-bottom: 10px solid #eee;
}
div#footer p {
margin: 0;
padding: 5px 10px;
text-align: center;
}
.headtitle {
float: left;
display: inline;
text-align: center;
width: 100%;
}
.headtitle a {
color: #ffffc0 !important;
}
.headtitle h1 {
font-size: 3.1em;
font-weight: bold;
margin: 5px 0 5px 0;
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<div class="headtitle">
<h1>Troy Yates.com</h1>
</div>
</div>
<div id="wrapper">
<div id="content">
Ipsum Lorem.
</div>
</div>
<div id="leftbar">
Ipsum Lorem.
</div>
<div id="footer">
Ipsum Lorem.
</div>
</body>
</html>