I'm hoping to achieve a scrollable middle section without the bottom scrollbar, and I prefer a CSS solution over using JavaScript for this. On my website, I have a 150px high div filled with icons and images that needs to be fixed while allowing the rest of the content to scroll vertically. Any suggestions on how to accomplish this?
Is there a way to prevent the scrollbar from extending into the bottom 30px of the container? I am aware of using another DIV to fill the space between the header and footer, but since I will be dynamically adding/removing elements, this workaround is not ideal for me.
Below is an example page I created to illustrate my concept:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Testing Page</title>
<style TYPE="text/css">
HTML
{
height:100%;
overflow:hidden;
}
BODY
{
height:100%;
margin:0;
overflow:hidden;
}
DIV#content
{
height:100%;
margin-bottom:-30px;
background-color:blue;
overflow:auto;
}
</style>
</head>
<body>
<div style="height:20px;background-color:green;width:100%;">top bar</div>
<div id="content">
main area
<div style="height:2000px;width:500px;background-color:yellow;">cool kids<div>
</div>
<div style="position:absolute;bottom:0;left:0;background-color:brown;height:30px;width:100%;">bottom bar</div>
</body>
</html>
Appreciate any guidance you can offer!