min-height does not work with body
HtmlCssHtml Problem Overview
Does min-height not work on body/html?
body, html
{
min-height:100%;
}
Accomplishes absolutely nothing (firebug reports the body,html tags height does not change at all)
Html Solutions
Solution 1 - Html
First, declare a doctype so you're in standards if you haven't already.
Now, the body can only be as high as the containing html, so you need to set HTML tag to 100% height, and body to min-height 100%. This works for me on Firefox.
html {height:100%}
body {min-height:100%}
Solution 2 - Html
This worked for chrome 64 without setting a hard-coded height:
html {
min-height: 100%;
display: flex;
}
body {
flex: 1;
}
Solution 3 - Html
Not all browsers like min-height, try something like this to catch all browsers.
min-height:100%;
height:auto !important;
height:100%;
Solution 4 - Html
I solved the problem with just:
body {
min-height: 100vh;
}
Solution 5 - Html
None of the above answers work for me.
What I did:
html, body {
height: 100%;
display: grid;
}
Solution 6 - Html
html{
height:100%;
}
body{
min-height:100%;
position:relative;
}
you must add