Work min-height: 100% can be understood by the example of installing adherent footer. At the same time there are styles:
* { margin: 0; padding: 0; } html, body, .wrapper { height: 100%; } .content { box-sizing: border-box; min-height: 100%; padding-bottom: 90px; } .footer { height: 80px; margin-top: -80px; }
And the markup:
<div class="wrapper"> <div class="content"> <p>ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй ййй </p> <p>ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц ццц </p> <p>ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу ууу </p> <p>ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк ккк </p> <p>еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее еее </p> </div> <div class="footer"></div> </div>
At the same time, min-height: 100% works like this:
If the CONTENTS are LITTLE for the content block, then its height is MINIMALLY equal to 100% of the height of the viewport (the wrapper is 100% of the height of the body , the body is 100% of the height of html , and html is 100% of the height of the viewport ). At the same time, the content block has a lower paddind buffer negative, and the block of the footer block has a negative margin , which allows, in case of a lot of content, to crawl onto this padding buffer.
If the content DOES NOT BREAK on the screen (the contents of MANY in the content block), then the height is determined by the content - the content stretches.
I repeat once more that everyone remembers - if the content is small, the block height is equal to the height of the viewport (this is the MINIMUM height value, that is, it cannot be less, and more - please, if you can stretch the content), if it is a lot - the block height is MORE The height of the viewport is determined by the content, which stretches it to this height.