some content
I\'m trying to place two divs one above the other. The top one has a fixed size. The bottom one needs to fill the rest of the page height, without making the page higher if
In case if anyone wants to solve this keeping things in normal flow, nowadays this can be done using the flexbox layout model as shown below:
* {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
}
#content {
display: flex;
flex-direction: column;
width: 300px;
height: 100%;
margin: 0 auto;
background-color: #C9E6FF;
}
#top-padding {
height: 30px;
flex: none;
background: blue;
}
#stuff {
flex: auto;
overflow-y: auto;
background-color: lightgreen;
}
/*for demo purpose */
#stuff p {
height: 1000px;
}
some content