I have a web page that has a full width header and footer, in between is a column at the left and to the right the main content section of the page.
The CSS code for the layout is modified from a recommendation I found on sitepoint for a 3-column layout, and I think I understand it, but it’s a bit complex and I’m not sure I didn’t make a mistake modifying it. (I’m still fairly new to CSS.)
In Firefox, the layout works perfectly, but in IE, if the browser window is too narrow, the contents of the main section jump down the page - the top of the main content will start below any content in the left-hand column.
Can anyone suggest why this happens and how I can fix it?
Here are the HTML and CSS for the page (sorry, they’re quite long):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>JnY - Luxury gifts for all occasions</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<link href="Englishstyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="outer">
<div id="header">
<div id="userinfo">
<table>
<td class="welcome"></td>
<td class="nobutton">
<a href="?login"> Log In </a>
</td>
<td class="nobutton">
<a href="?register"> Register </a>
</td>
<td>
<form action="" method="post">
<label for="usercountry">Country:</label>
<select name="usercountry" id="usercountry">
<option selected="selected">Australia</option>
<option>Australia</option>
<option>한국</option>
<option>中国</option>
</select>
<input class="nobutton" type="submit" name="setcolacu" value=" Change " />
</form>
</td>
</table>
</div> <!-- end of user info div -->
<div id="sitebranding">
<img src="images/JnY logo.gif" class="featureleft" alt="JnY logo" width="120" height="80" />
<div id="topbuttons">
<p>
<a href="?homepage">Home</a>
<a href="?aboutus">About Us</a>
<a href="?contactus">Contact Us</a>
<a href="?shoppingcart">Shopping Cart</a>
( items) <a href="?wishlist">Wish List</a>
( items) </p>
</div>
</div> <!-- end of sitebranding -->
<div id="tagline">
<p>Luxury gifts for all occasions</p>
</div> <!-- end of tagline -->
</div> <!-- end of header -->
<div id="mainnavigation">
<div id="topnavigation">
<h3>Our Products</h3>
<ul>
<li>
<img height = "18px" width = "18px" src="images/hearticon2.gif" alt="" />
<a href="?categpage&id=5">Original Art Works</a>
</li>
<li>
<img height = "18px" width = "18px" src="images/hearticon2.gif" alt="" />
<a href="?categpage&id=3">Organic Health</a>
</li>
<li>
<img height = "18px" width = "18px" src="images/hearticon2.gif" alt="" />
<a href="?categpage&id=4">Wine</a>
</li>
<li>
<img height = "18px" width = "18px" src="images/hearticon2.gif" alt="" />
<a href="?categpage&id=2">Ceramics</a>
</li>
<li>
<img height = "18px" width = "18px" src="images/hearticon2.gif" alt="" />
<a href="?categpage&id=18">Bookmarks</a>
</li>
<li>
<img height = "18px" width = "18px" src="images/hearticon2.gif" alt="" />
<a href="?categpage&id=15">Cars</a>
</li>
<li>
<img height = "18px" width = "18px" src="images/hearticon2.gif" alt="" />
<a href="?categpage&id=19">Passion</a>
</li>
</ul>
</div> <!-- end of topnavigation -->
<div id="quicklinks">
<h3>Quick links</h3>
<ul>
<li>
<a href="?howtobuy">How to buy</a>
</li>
<li>
<a href="?payment">Payment methods</a>
</li>
<li>
<a href="?shipping">Shipping information</a>
</li>
<li>
<a href="?storeloc">Store locations</a>
</li>
<li>
<a href="?sitemap">Site map</a>
</li>
</ul>
</div> <!-- end of quick links -->
</div> <!-- end of mainnavigation -->
<div id="maincontent">
<div class="aboutus">
<h2>Welcome to JnY's web site</h2>
<p>JnY Co is an international company which is just starting out (September 2009).</p><p>We hope to join the growing band of international shopping mall sites, and plan to focus on beautiful <br/>luxury gift products such as fine ceramic ware for the home, unique designer jewellery, elegant accessories <br/>for the well-tailored, delicate perfumes, wines to suit the discerning palate and much more.</p><p>You are welcome to browse through our fledgling site and contact us if you find something you are <br/>interested in.</p><p>Please come back in a few weeks to enjoy the experience of purchasing on our site!</p>
</div>
</div> <!-- end of maincontent -->
<div id="clearfooter">
</div>
</div>
<div id="pagefooter">
<div id="footbutt">
<p>
<a href="?homepage">Home</a>
<a href="?aboutus">About Us</a>
<a href="?contactus">Contact Us</a>
<a href="?termsofuse">Terms of Use</a>
<a href="?privpol">Privacy</a>
</p>
<p>JnY Co, Hamilton Place, Mt Waverley, Victoria, 3149, Australia. ABN 123456789. </p><p>Phone: (03) 99998888 Fax: (03) 99998888 Email: [email]pat@joynyoung.com[/email]</p> </div>
</div> <!-- end of pagefooter -->
</body>
</html>
/* CSS for JnY web site */
body {
font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
font-size: 12;
}
a:link {
color: navy;
}
a:active {
color: navy;
}
a:visited {
color: navy;
}
a:hover {
color: navy;
}
#header {
background-color: white;
}
#outer {
background-color: #e9f3fe;
background-image: url(images/1stpicforbackground.gif);
background-repeat: repeat;
background-position: top left;
}
#pagefooter {
background-color: #ebead0;
}
#userinfo {
height:30px;
}
#userinfo table {
white-space: nowrap;
float: right;
}
#topbuttons p {
margin-left: 187;
margin-top: 90;
}
#footbutt {
margin-left: 187;
}
#topbuttons a, #footbutt a {
font-size: 14px;
font-weight: bold;
color: navy;
text-decoration: underline;
padding-left: 4px;
padding-right: 4px;
}
#topbuttons a:hover, #footbutt a:hover {
font-size: 16px;
font-weight: bold;
color: navy;
text-decoration: underline;
padding-left: 4px;
padding-right: 4px;
}
#topnavigation ul {
padding-left: 10px;
margin: 0;
}
#topnavigation li {
border: solid 2px #c53a12;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
text-align: left;
font-size: 14;
font-weight: bold;
text-indent: -10px;
padding: 0;
padding-left: 20px;
margin-bottom: 2px;
margin-left: 0;
margin-right: 5px;
}
#topnavigation a {
text-decoration:none;
}
#quicklinks h3 {
padding-top: 60px;
}
#quicklinks ul {
padding-left: 10px;
margin: 0;
}
#quicklinks li {
text-align: left;
font-size: 14;
font-weight: bold;
padding: 0;
padding-left: 20px;
margin-bottom: 2px;
margin-left: 0;
margin-right: 5px;
}
#sitebranding {
border-top: 3px solid #000000;
background-color: #ebead0;
padding-top: 0;
padding-bottom: 0;
padding-left: 0;
margin: 0;
height: 115px;
background-image: url(images/gifts.jpg);
background-repeat: no-repeat;
background-position: top right;
}
h1 {
font-size: 40px;
color: #ebead0;
padding-top: 0;
padding-bottom: 0;
padding-left: 8px;
margin: 0;
text-align:left;
white-space: nowrap;
}
h2 {
color: navy;
font-size: 30px;
font-weight: normal;
padding-top: 15px;
margin-top: 15px;
margin-bottom:0;
padding-bottom:0;
border:0;
white-space: nowrap;
}
h3 {
color: navy;
font-size: 16px;
font-weight: bold;
padding-top: 5px;
padding-left: 13px;
margin-top: 0;
margin-bottom:0;
padding-bottom:3px;
border:0;
whate-space: nowrap;
}
.featureleft {
float: left;
margin-left: 20;
margin-top: 15;
margin-right: 20px;
}
.featureright {
float: right;
margin: 0;
margin-top: 0;
margin-left: 20px;
}
.nobutton {
padding-top: 4px;
border: none;
color: navy;
font-size: 14;
font-weight: bold;
text-decoration: underline;
background: inherit;
vertical-align: top;
}
.nobutton:hover {
font-size: 16;
padding-top: 4px;
border: none;
color: navy;
font-weight: bold;
text-decoration: underline;
background: inherit;
vertical-align: top;
}
.nobutton a {
padding-top: 4px;
padding-right: 4px;
padding-left: 4px;
border: none;
color: navy;
font-size: 14;
font-weight: bold;
text-decoration: underline;
background: inherit;
vertical-align: top;
}
.nobutton a:hover {
font-size: 16;
padding-top: 4px;
padding-right: 4px;
padding-left: 4px;
border: none;
color: navy;
font-weight: bold;
text-decoration: underline;
background: inherit;
vertical-align: top;
}
.aboutus p {
font-size:14px;
color:navy;
margin-left: 60px;
padding-left: 5px;
white-space: nowrap;
}
.aboutus h2 {
margin-left: 60px;
padding-left: 5px;
white-space: nowrap;
}
#tagline p {
text-align: left;
vertical-align: top;
font-style: italic;
font-size: 20px;
font-family: Georgia, Times, serif;
background-color: #acacac;
border-top: 3px solid #aaaaaa;
border-bottom: 3px solid #aaaaaa;
padding-top: 4px;
padding-bottom: 4px;
padding-left: 15px;
margin: 0;
white-space:nowrap;
}
li {
list-style-type: none;
font-size: 12px;
line-height: 18px;
}
#pagefooter p {
font-size: 14px;
font-weight: normal;
color: navy;
margin: 4px;
padding-left: 4px;
padding-right: 4px;
white-space: nowrap;
}
/* This section deals with the position of the items on the screen. It uses absolute positioning measured in pixels from the top left of the screen. */
html, body {height:100%}
body {
padding:0;
margin:0;
background-color: #ffcc00;
color:navy;
}
#outer{
min-height:100%;
margin-left:180px;
border-left:1px solid #000;
border-right:1px solid #000;
margin-bottom:-92px;
background-color:#e9f3fe;
color:navy;
}
* html #outer{height:100%;} /* IE6 and under treat height as min-height anyway*/
#header{
position:relative;
margin:0 0 0 -181px;
padding-top:5px;
min-height:0;/* ie 7 haslayout fix */
}
/* mac hide \\*/
* html #header{height:56px;he\\ight:1px}/* height needed for ie to force layout */
/* end hide*/
#mainnavigation {
position:relative;/*ie needs this to show float */
width:180px;/* same as the left margin on #outer*/
float:left;
margin-left:-179px;/*must be 1px less than width otherwise won't push footer down in older mozilla*/
left:-2px;/* push column into position*/
background-color:#ffcc00;
color:navy;
}
#mainnavigation p {padding-left:2px;padding-right:2px}
#mainnavigation h3 {padding-left:2px;padding-right:2px}
#pagefooter {
/* width:100%; */
clear:both;
height:90px;
border-top:1px solid #000;
border-bottom:1px solid #000;
position:relative;
}
* html #pagefooter {/*only ie gets this style*/
\\height:92px;/* for ie5 */
he\\ight:90px;/* for ie6 */
}
#clearfooter{clear:both;height:90px;}/*needed to make room for footer*/
* html #maincontent {height:1%;margin-bottom:12px}/* combat IE's 3 pixel jog */