I am working on adjusting my site to a 100% Height CSS Layout. However, the Footer div is not viewing properly in IE6 — it shifts to the right. The problem seems to occur when I set the footer position to Absolute. The html consists of mainly the container, header, content, main-content, and footer — as follows:
The html:
[CODE]
<head></head>
<body onLoad=””>
<div class=”bodyBG_left”></div>
<div class=”bodyBG_right”></div>
<div id=”container”>
<div id=”header”>
<h1 id=”display_homepage_title” class=”colors_homepage_title”></h1>
<div id=”header_nav”></div>
<div id=”shopping_cart_summary”></div>
<div id=”content” class=”clearfix”>
<table border=”0″ cellspacing=”0″ cellpadding=”0″ height=”100%”>
<tr>
<td id=”main_content” valign=”top”>
<script type=”text/javascript”>
document.getElementById(‘search_field’).value = QueryString(‘Search’);
</script>
<div id=”content_area”>
<div align=”center”><img src=”#” width=”760″ height=”63″ border=”0″ align=”middle” usemap=”#Map”></div>
<div align=”center”>
<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=”http://active.macromedia.com/flash6/cabs/swflash.cab#version=6.0.0.0″ height=”400″ width=”760″>
<param name=”movie” value=”#”>
<param name=”play” value=”true”>
<param name=”loop” value=”true”>
<param name=”WMode” value=”Opaque”>
<param name=”quality” value=”high”>
<param name=”align” value=””>
<embed src=”#” play=”true” loop=”true” wmode=”Opaque” quality=”high” pluginspage “http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash” align=”” height=”400″ width=”760″>
</object>
</div>
<div style=”margin: 15px;” >
<div align=”justify”><span class=”style1″>Text Goes Here </span><a href=”#” target=”_self” class=”style1″>Read More >></a> </div></div> </td>
</tr>
</table>
</div>
<div id=”footer”>
<div id=”footer_top”>
<ul>
<li><a href=”#>About</a></li>
<li><a href=”#”>Press</a></li>
<li><a href=”#”>Contact</a></li>
<li><a href=”#”>Feedback</a></li>
<li><a href=”#”>Blog</a></li>
<li class=”last”><a href=”javascript:addbookmark()”>Bookmark</a></li>
</ul>
</div>
<div id=”footer_bottom”>
<ul>
<li><a href=”#”>Terms</a></li>
<li><a href=”#”>Privacy</a> </li>
<li><a href=”#”>Index</a> </li>
<li class=”last”><a href=”#” class=”footer colors_background2_text”>Help</a></li>
</ul>
<p><a href=”/Terms.asp”>Copyright © 2008 Company. All Rights Reserved.</a></p>
</div>
</div>
</div>
</body>
And the CSS:
[CODE]
body, html{ height: 100%; }
body{
text-align:center;
margin:0;
padding:0;
height: 100%; /* needed for container min-height */
font-size:12px;
background-color:#2e3337;
background-image:url();
background-repeat:repeat-x;
background-position:top left;
font-family: Arial, Tahoma, helvetica, sans-serif;
}
.clearfix:after {
content: “.”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {display: inline-block;}/* Hides from IE-mac */
.clearfix {display: block;}
* html .clearfix {height: 1%;}/* End hide from IE-mac */
#body a{
text-decoration:none;
}
body #header ul li.last{
margin:0;
padding:0;
border:none;
}
#body a:hover{
text-decoration:underline;
}
#container {
position:relative; /* needed for footer positioning*/
margin:0 auto; /* center, not in IE5 */
width:790px;
height:auto !important; /* real browsers */
height:100%; /* IE6: treaded as min-height*/
min-height:100%; /* real browsers */
background-color: #FFFFFF;
}
#header{
width:790px;
height:100px;
padding:0;
margin:0px auto;
position:;
border-bottom:0px solid #adadad;
}
#header h1{
width:491px;
height:67px;
position:absolute;
top:10px;
left:23px;
font-size:1.5em;
text-align:left;
}
.header_background{
background:url() no-repeat left top;
}
#top_nav{
padding:0px 0px 0px 0px;
margin:0px 15px 0px 0px;
width: 100%;
font-size:14px;
text-align:right;
padding-top:5px;
padding-bottom:5px;
border-bottom:0px solid #adadad;
background-color: #FFFFFF;
}
#top_nav ul{
list-style:none;
margin:0;
padding:0;
}
#top_nav ul li{
display:inline;
margin-right:1em;
padding-right:1em;
border-right:0px solid #adadad;
}
#top_nav ul li a{
color:gray;
font-weight:normal;
}
#top_nav h1 a:hover{
color:#666666;
}
#header_nav {
position:absolute;
top:0px;
right:0;
text-align:left;
font-family: Arial, Tahoma, helvetica, sans-serif;
font-size:11px;
padding:10px;
}
#header_nav ul{
list-style:none;
margin:0;
padding:0;
}
#header_nav ul li{
display:inline;
margin-right:1em;
padding-right:1em;
border-right:1px solid #adadad;
}
#header_nav ul li a{
color:gray;
font-weight:normal;
}
#content{
padding:0;
margin:0px auto;
text-align:left;
width:790px;
background-color: #FFFFFF;
padding:0em 0em 0em; /* bottom padding for footer */
padding-bottom: 120px; /* bottom padding for footer */
}
#content #main_content{
padding:0px;
margin:0px;
width:790px;
border-right:0px solid #ADADAD;
border-left:0px solid #ADADAD;
background-color: #FFFFFF;
}
#footer{
margin:0px auto;
padding:0px;
width: 790px;
height: 115px;
font-family: Arial, Tahoma, helvetica, sans-serif;
color:#adadad;
background-color: #FFFFFF;
padding-bottom:1em;
width:100%;
bottom:0; /* stick to bottom */
position:relative;
}
#footer > *{
margin:0;
padding:0;
}
#footer ul li.last{
border:none;
padding:0;
margin:0;
}
#footer a{
color:#666666;
font-family:Arial, Helvetica, sans-serif;
}
#footer ul{
list-style:none;
margin:0;
padding:0;
}
#footer ul li{
display:inline;
border-right:1px solid #adadad;
margin-right:1em;
padding-right:1em;
}
#footer_top{
margin-bottom:1.5em;
padding:10px;
border-top: 1px solid #adadad;
color:gray;
}
#footer_top a{
color:gray;
}
#footer_top ul li{
border-right:1px solid gray;
}
#footer_bottom{
margin:0;
padding:0;
font-size:11px;
color:#666666;
}
#footer_bottom a{
font-size:11px;
}
.bodyBG_left, .bodyBG_right {
position:absolute;
left:50%;
top:0px;
width:171px;
height:700px;
}
.bodyBG_left {
margin-left:-567px;
background: url() left top no-repeat;
}
.bodyBG_right {
margin-left:397px;
background: url() right top no-repeat;
}
#nav_menu div.nav_section{
margin:0;
padding:0;
width:160px;
margin-bottom:1em;
}
#shopping_cart_summary{
margin:0;
padding:0;
text-align:center;
color:#666;
font-weight:normal;
position:absolute;
top:60px;
right:20px;
font-size:12px;
padding:5px;
}
#nav_menu #shopping_cart_summary h3{
margin-bottom:.5em;
}
div.nav_section ul{
margin:0;
padding:0;
list-style:none;
text-align:left;
margin-top:4px;
margin-left:0px;
}
#nav_menu{
margin:0;
padding:0;
width:160px;
border:0px solid #adadad;
border-bottom:none;
border-top:none;
height:100%;
}
#nav_menu h3{
margin:0px 0px 0px 5px;
padding:0px;
font-size:1em;
border-top:0px solid #adadad;
border-bottom:1px solid #cccccc;
color:#666666;
padding:5px;
text-align:left;
}
div.nav_section ul li{
margin:0;
padding:0;
color:#606060;
font-family:Arial, Helvetica, sans-serif;
font-size:10px;
text-align:left;
margin-bottom:.5em;
padding-left:15px;
background:url() no-repeat 3px 3px;
}
div.nav_section ul li a{
color:#606060;
text-decoration:none;
list-style:none;
font-size:1.1em;
font-weight:normal;
}
div.nav_section ul li a:hover{
text-decoration:underline;
}
#navigation_menus{
padding:0px;
margin:0;
width:160px;
text-align:center;
}
#notext a {
display:block;
width:250px;
height:75px;
text-indent:-9999px;
}
#search_section{
padding:0;
margin:0;
text-align:left;
width:160px;
margin-bottom:10px;
}
#search_section form{
margin:10px 5px;
padding:0px;
margin-left:10px;
height:34px;
}
#search_section input{
margin:0px;
padding:0px;
vertical-align:middle;
}
*html #search_section form{
margin:10px 0px;
margin-left:5px;
height:24px;
}
#search_section input#search_field{
margin:0px;
border:1px solid #adadad;
width:115px;
height:20px;
vertical-align:middle;
font-size:10px;
padding:2px;
}
*html #search_section input#search_field{
height:20px;
width:110px;
}
#search_section input#search_button{
margin:0;
padding:0;
width:20px;
height:20px;
}
#search_section h3{
border-top:none;
}
span.ir{
display:none;
}
#display_cart_summary .cartsummary_empty {
display: none;
}
#display_cart_summary .cartsummary_full {
background-color: #CCCCCC;
border-bottom-width: 0px;
border-right-width: 0px;
border-top-width: 0px;
border-left-width: 0px;
border-style: solid;
border-color: #000000;
text-align: center;
}
#display_homepage_title a{
text-indent:-99999px;
display:block;
width:300px; height:40px;
text-align:left;
}
#display_homepage_title #homepage_title{
text-indent:0;
display:block;
width:573px;
height:40px;
font-size:30px;
background:transparent;
margin-top:10px;
margin-left:10px;
text-align:left;
}