div's height like remaining height

2020-07-18 08:05发布

问题:

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?

回答1:

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;
}


标签: css xhtml html