I am trying for the life of me to make a simple page with a container that stretches to the bottom. The desired outcome:
#Main
is at least as tall as the viewport, but can stretch further if content is added.body
is at least as tall as the viewport, but can stretch further if content is added.html
is at least as tall as the viewport, but can stretch further if content is added.
I don't know why this is seemingly impossible. I've tried every combination of height, min-height, etc, but they all fail in one way or another. There is something about <body>
where min-height
doesn't work.
Here's a fiddle: https://jsfiddle.net/r51tvu2b/
Notice that body
isn't honoring the min-height: 100%
declaration. I am irritated beyond imagination right now.
Note: I've found solutions that "work", but when content is added the body
remains at 100% the viewport height, which is not the desired outcome. That is, in my fiddle, the red line should extend to the bottom of the viewport, and if content is longer, to the bottom of the content.