I am facing a challenge with two div
s on my webpage. The bottom one contains content that expands the highest. The page is set to 100% height and width using the CSS property position: absolute
.
<style>
body, html { height:100%, width:100% }
.page { position: absolute; height: 100%; top: 0; right: 0; left: 0; bottom: 0}
.bottom { position absolute; bottom: 0; right: 0; left: 0; }
.top { position absolute; bottom: 0; right: 0; left: 0; }
</style>
I need help figuring out how to make it so the top div
adjusts its size based on whatever space is left by the bottom div
. For example, if the window height is 600px
, the bottom div takes up 400px
and the top div should take up the remaining 200px
.