Maybe I missed the mark. And I kinda sort of had to cheat anyway ( I used box-sizing), but hopefully this helps:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body, html {height:100%}
body, html, h2, h3 {margin:0; padding:0}
.outter{
position: relative;
margin: -1px 25%;
top:8%;
height: 84%;
overflow: auto;
padding:50px 0;
-moz-box-sizing: border-box ;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid pink;
min-height: 4em;
}
.content {
overflow: auto;
height: 100%;
}
h2,h3{position: absolute; background: pink; width: 100%; height: 50px}
h2{top:0}
h3{bottom:0}
</style>
</head>
<body>
<div class="outter">
<div class="content">
<h2>Representing the fixed header</h2>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.lorem
<h3>Representing the fixed Footer</h3>
</div>
</div>
</body>
</html>
The premise here being that you need an outer container to place everything on the screen, and to serve as a positioning reference for the FIXED HEIGHT header and footer. This outer container is your over all height (84%). We make room for the header and footer by adding padding. Of course , the padding would have foobarred the height of the outer container :/ , which is why I used box-sizing. Then you need an INNER container that is set to height:100% and overflow:auto. and finally content...
If the content is more than 100% of the height of the inner container then it will overflow and thus you get scroll bars as needed.
Bookmarks