I have an HTML page with a fixed height header and footer and an element in between.
I want the element to always have a total screen height (excluding the header and footer). For example, suppose that the total height of the screen is 1000 pixels, and each header / footer has a fixed height of 60 pixels โ the height of the div element should be 880 pixels. Now I have a task to make it responsive (regardless of screen size, the behavior should be as described) WITHOUT using JavaScript / JQuery. CSS only.
I started by using "height: 100%" but donโt know how to proceed ...
<html> <head></head> <body> <header class="header">my header</header> <div class="content">content</div> <footer class="footer">my footer</footer> </body> </html>
http://codepen.io/anon/pen/QbGZgL
Note: IE 10 must also be supported ...
I reviewed flexbox, but did not understand how exactly I can use it for my needs. Say I have text and some images in the content of the page. I donโt want the vertical scroller to appear when the screen is smaller, I want all the content to be compressed so that it fills the available height.
Are there CSS3 viewport elements: vh / vw / vmin / vmax can help me here?
source share