Length
Length data type represents a distance value.
It consists of a number and one of the units listed below. (Sometimes, you can also use percentages for this data type.)
Length Units
Absolute Length Units
px— one pixel (1 px = 1/96 in)cm— one centimetermm— one millimeterin— one inchpc— one pica (1 pc = 1/6 in)pt— one point (1 pt = 1/72 in)
Font-Relative Lengths
em— represents the calculated font-size of the elementrem— represents the calculated font-size of the root element ("root em"), typically refers to the font size of the<html>elementch— represents the width of the0(zero) glyphex— represents the x-height of the element's font
Viewport-Percentage Lengths
vh— 1 vh = 1% of viewport heightvw— 1 vw = 1% of viewport widthvmin— picks the minimum ofvhorvwvmax— picks the maximum ofvhorvw
References
- <length> (MDN) — https://developer.mozilla.org/en-US/docs/Web/CSS/length