I am working on a web application where I want the content to fill the height of the entire screen. How to make the div
(other-child
) fills its parent automatically without doing calculation on its height.
html {
height:100%;
}
body{
height: 100%;
box-sizing: border-box;
margin: 0;
padding: 0;
}
#parent {
height:100%;
}
#child {
height:50px;
background:yellow;
}
#other-child{
background:red;
/* height: 100% */
}
<html>
<body>
<div id="parent">
<div id="child" >fixed height</div>
<div id="other-child">occupy the rest</div>
</div>
</body>
</html>