Welcome to the Treehouse Community
Looking to learn something new?
Alexandre Gomes4,775 Points
Why "min-height" instead of "height" for the wrapper ?
Why do we have to use min-height to define the wrapper height ? Could't we just use "height" to define the height of the wrapper, instead ?
Because if the wrapper ever happened to be more than (100% viewport height - footer height), there would than be a scrolling bar, isn't it ? So why not just use height instead.
Thanks for the answer :)
Nicholas Grenwalt46,626 Points
It is mainly due to specificity. Min-height takes precedence over both height and max-height ensuring that you get the result you want and that it isn't accidentally overwritten later by a height or max-height call.
If you used height then the wrapper will always remain that height even if there's more content. The content will overflow the wrapper and overlap with the footer. The wrapper will not expand to contain the extra content and the footer will not be pushed further down. I recommend that you switch to
height and add in enough extra content to see how this looks.
With min-height, you're saying that the wrapper can't be less than this height but it can increase if the content requires it.