mikhial66
08-06-2011, 10:55 PM
I'm trying to make a site layout with a sticky footer and a header that go the width of the page. The content div should be 960px wide, and the height should go from the bottom of the header to the top of the footer. My problem is that I can't figure out how to get the content div to go just to the footer. The page (and content div) want to extend the height of the header past where the page should end.
Thanks
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>FBK</title>
</head>
<body>
<div id ='wrap'>
<div id='header'>
</div>
<div id='content'>
</div>
<div id='footer'>
</div>
</div>
</body>
</html>
html{
height: 100%;
min-height: 100%;
}
body{
min-height: 100%;
width: 100%;
height:100%;
}
#wrap{
height:auto;
height:100%;
min-height:100%;
position:relative;
margin:auto;
}
#header{
background: blue;
height: 152px;
}
#content{
background: #555;
min-height: 100%;
margin: 0 auto;
width: 960px;
}
#footer{
margin-bottom: 41px;
height: 59px;
background: red;
position:absolute;
width:100%;
bottom:0;
}
How it looks:
http://img21.imageshack.us/img21/8005/layout1qo.png
How it should look:
http://img15.imageshack.us/img15/6369/layout2sp.png
Thanks
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>FBK</title>
</head>
<body>
<div id ='wrap'>
<div id='header'>
</div>
<div id='content'>
</div>
<div id='footer'>
</div>
</div>
</body>
</html>
html{
height: 100%;
min-height: 100%;
}
body{
min-height: 100%;
width: 100%;
height:100%;
}
#wrap{
height:auto;
height:100%;
min-height:100%;
position:relative;
margin:auto;
}
#header{
background: blue;
height: 152px;
}
#content{
background: #555;
min-height: 100%;
margin: 0 auto;
width: 960px;
}
#footer{
margin-bottom: 41px;
height: 59px;
background: red;
position:absolute;
width:100%;
bottom:0;
}
How it looks:
http://img21.imageshack.us/img21/8005/layout1qo.png
How it should look:
http://img15.imageshack.us/img15/6369/layout2sp.png