Is it possible?
I have two divs. One has a fixed height and I want the other one to fill the remaining vertical space on the window. If I set the latter div's height to 100%, it'll make it the same height as the window, but I want it to be the height of the window minus the height of the first div.
This is the code I'm using:
I also included some images that show what I want to do and what I've been able to do so far. Thanks in advance
I have two divs. One has a fixed height and I want the other one to fill the remaining vertical space on the window. If I set the latter div's height to 100%, it'll make it the same height as the window, but I want it to be the height of the window minus the height of the first div.
This is the code I'm using:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>Vertical div test</title>
<style type="text/css" media="screen">
body {
margin:0;
padding:0;
height:100%;
}
#div1 {
height: 100px;
background-color: blue;
}
#div2 {
height: 100%;
background-color: green;
}
</style>
</head>
<body>
<div id="div1">
</div>
<div id="div2">
</div>
</body>
</html>
I also included some images that show what I want to do and what I've been able to do so far. Thanks in advance