Viewport-percentage lengths: the vw, vh, vmin, vmax units

Excerpt from w3.org:

The viewport-percentage lengths are relative to the size of the initial containing block. When the height or width of the initial containing block is changed, they are scaled accordingly. However, when the value of overflow on the root element is auto, any scroll bars are assumed not to exist. Note that the initial containing block’s size is affected by the presence of scrollbars on the viewport.

When I design a new layout, I’ll keep in mind this option because it’s pretty handy if we think in terms of responsive design.

vw unit: Equal to 1% of the width of the initial containing block.
vh unit: Equal to 1% of the height of the initial containing block.
vmin unit: Equal to the smaller of vw or vh.
vmax unit: Equal to the larger of vw or vh.

Here is my CSS:

Here is the HTML code:

Try it Yourself / Demo