I’m trying to get the shorter content pages of my site to fill the vertical height of the browser with the background colors of the DIV (#f6f6f6 and #fff)
I’ve tried “height: 100%;”, “max-height: 100%;”, and “height: 100vh;” but nothing seems to do the trick - or it does, but then it breaks the layout on the longer content pages.
An example of the shorter page (the #333 background shouldn’t be visible below the content, only on the right and left sides of a browser > 1280px): http://motionphi.com/v6/am.html
If you set a height then that height will never be exceeded (i.e. content will overflow). You need to set a min-height and then content can grow.
e.g.
.main {height:auto;min-height:100vh}
Or use display:table and then height automatically becomes a minimum.
Remember that when using 100% you will get a full 100% so the element can’t be nested some way down the page as it will either lose its height (when not using vh) or you will get 100% from where you are which will end miles below the fold.
Some older versions of Chrome still need html,body set to 100% even when using vh units. To support all browsers back to IE8 I would simply use this.