Three divs each above the other, in the parent container. The top div is a fixed height. The bottom div has content that takes up an unknown amount of vertical space, but all content is required to display it. The top div should fill the remaining vertical space. Everyone
<div id="container"> // 100% of visible window height but should not overflow <div id="top"> // Fixed height </div> <div id="middle"> // Use remaining vertical space </div> <div id="bottom"> // Unknown height but contents should all be shown </div> </div>
I need to support the latest browsers (e.g. IE9 +) and mobile browsers (e.g. Android 4.4+), so flexbox layouts are missing. I tried Javascript (using jQuery) to try to install
middle div height = container height - (top div height + bottom div height)
but for some reason, the browser incorrectly reported the lower height of the div when rendering the page (the last Chrome on Win 7), so the result was incorrect. And I would like to avoid JS if possible (open if the solution works).
It is necessary to support as many desktop and mobile browsers as possible. Thanks
javascript jquery android html css
Alex kerr
source share