Här har du ett exempel som fungerar på allt som jag har testat den på.
HTML-kod:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Sajt</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="header_960">
<p>header</p>
</div>
</div>
<div id="content">
<div id="content_960">
<p>content</p>
</div>
</div>
</div>
<div id="footer">
<div id="footer_960">
<p>footer</p>
</div>
</div>
</body>
</html>
HTML-kod:
body, html{
height: 100%;
}
body, p {
margin: 0; padding: 0;
}
#wrapper {
min-height: 100%;
}
* html #wrapper {
height: 100%;
}
#header {
width: 100%;
background: #666;
}
#header_960 {
width: 960px;
height: 100px;
margin: 0 auto;
position: relative;
overflow: hidden;
}
#footer {
width: 100%;
height: 100px;
margin: -100px auto 0 auto;
position: relative;
background: #666;
}
#footer_960 {
width: 960px;
height: 100px;
position: relative;
margin: 0 auto;
}
#content {
width: 100%;
padding-bottom: 100px;
}
#content_960 {
width: 960px;
margin: 0 auto;
overflow: hidden;
}