view width code example

Example 1: css viewport

<meta name="viewport" content="width=device-width, initial-scale=0.9, user-scalable=no">

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: em css

/*realative to the font-size*/

Example 4: what are the viewport based units in html

The viewport based units are:
vh , vw , vmin, vmax .

Tags:

Misc Example