Currently, I'm developing a web application and aiming to have the content span the full height of the screen. Is there a way to make the div
element (other-child
) automatically fill its parent without having to manually set 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>