Blake
03-01-2007, 06:40 PM
Suppose I make a web with a header 100 pixels high, and I want the content of the page to fill the rest of the window; ie I have the following:
<html>
<head>
<style type="text/css">
.header
{
width: 100%;
height: 100px;
}
.content
{
width: 100%;
overflow: auto;
}
</style>
</head>
<body>
<div class="header">
Header here
</div>
<div class="content">
Content here
</div>
</body>
</html>
Now, I want the content to be 100 pixels less than the full height of the window. Is there a way to do that without using javascript?
Setting the height to 100% doesn't work; that makes the div extend 100 pixels beyond the bottom of the window.
<html>
<head>
<style type="text/css">
.header
{
width: 100%;
height: 100px;
}
.content
{
width: 100%;
overflow: auto;
}
</style>
</head>
<body>
<div class="header">
Header here
</div>
<div class="content">
Content here
</div>
</body>
</html>
Now, I want the content to be 100 pixels less than the full height of the window. Is there a way to do that without using javascript?
Setting the height to 100% doesn't work; that makes the div extend 100 pixels beyond the bottom of the window.