css vw meaning code example
Example 1: vw css
Viewport Width (vw). This unit is based on the width of the viewport.
A value of 1vw is equal to 1% of the viewport width.
Example 2: vh and vw
/*vh viewport height and vw viewport width*/
/*example*/
div
{
display: inline-block;
height: 100vh; /*THis will set height equal to the height of windows*/
width: 100vw/*This will set width equal to width of windows*/
}
Example 3: what is em in css
'em' units for the font-size property will be relative to the'font-size of the parent element'.
'em' units on other properties other than font-size will be relative to the
font-size of the current element. 'rem' units sizes will always be relative
to the font-size of the root html element.
Example 4: vw css
Viewport Width (vw). This unit is based on the width of the viewport. A value of 1vw is equal to 1% of the viewport width. Viewport Minimum (vmin). This unit is based on the smaller dimension of the viewport.