01.12.2015 18:12

Статьи CSS viewport width and height (vw, vh)

Viewport-percentage lengths defined a length relatively to the size of viewport, that is the visible portion of the document. Only Gecko-based browsers are updating the viewport values dynamically, when the size of the viewport is modified (by modifying the size of the window on a desktop computer or by turning the device on a phone or a tablet).

1vh - 1% of height

1vw - 1% of width

vmin and vmax - minimum and maximum value from width and height.


<meta name="viewport" content="width=device-width, initial-scale=1"/>

Browser support: here.

Source: Mozilla Developer Network

Leave a Reply