tags:

views:

52

answers:

1

i have two div

 <div id="uno">
    text      
 </div>
 <div id="due">
    text
 </div>

div#uno{
  width:300px; 
  height: 100px;
  border: 1px solid blue;
  overflow:hidden;
}

div#due{
   width:300px; 
   height: 200px; 
   border: 1px solid yellow;
    overflow:scroll;
}

how can i have the height of the div id="due" equal to the remaining height of the page?

+3  A: 

Make sure you have a HTML 4.01 or XHTML 1.x or later doctype specified:

div#uno{
 position:absolute;
 width:300px;
 height:100px;
 top:0px;
 border:1px solid blue;
 overflow:hidden;
}

div#due{
 position:absolute;
 width:300px;
 top:100px;
 bottom:0px;
 border:1px solid yellow;
 overflow:scroll;
}
David
damn... beat me to it, i was just typing out the same solution
brad
@brad +1 for great minds think alike :P
David
You mean a *strict* doctype, as transitional HTML doctypes will trigger quirks mode. See [this table](http://hsivonen.iki.fi/doctype/#handling). Moreover, this solution doesn't work in IE < 7.
Marcel Korpel
Agreed, it does not work in IE6. Erick, if you need to support IE6, I can give you an additional rule that will fix it for that browser. It is non-standard however which is why I will leave it out unless you need it. I recommend you leave IE6 in the dust, rather than include non-standard code for it.
David