So i have been trying to make the transition to CSS-P, unfortunately things haven't been turning out quite as I had hoped. I coded my home page but when i tested it at different resolutions the footer didn't display correctly, so I went back to try and make the basic layout work and that's where I'm stuck.
What I'm trying to do is have a header, a footer and two fixed width columns centered in the page. I can get everything to work apart from the 100% height.
Please someone help! I just can't figure out where I've gone wrong.
Here's the script:
<!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">
<head>
<style type="text/css">
html,body {
margin:0;
padding:0;
height:100%;
background:333;
}
div#clear {
clear:both;
}
div#container {
position:relative;
margin:0 auto;
width:994px;
background:#f0f0f0;
height  !important;
height:100%;
min-height:100%;
}
div#header {
height:79px;
width:994px;
background:#ddd;
}
div#rightcol {
float:right;
width:340px;
height:100%;
min-height:100%;
padding:5px 5px 84px 5px;
background:#356;
color:#fff;
}
div#leftcol {
width:634px;
height:100%;
min-height:100%;
background:#000;
padding:5px 5px 84px 5px;
float:left;
color:#fff;
}
div#footer {
position:absolute;
bottom:0;
height:79px;
width:994px;
background:#cc3333;
}
</style>
</head>
<body>
<div id="container">
<div id="header">header</div>
<div id="clear"></div>
<div id="rightcol">right col</div>
<div id="leftcol">left col</div>
<div id="clear"></div>
<div id="footer">footer
</div>
</div>
</body>
</html>
|