MENU
Relative Length Units
eg.
font-size {height: 100%;}
- 30% --- percent of the available length
- 80vh --- 80% of the viewport height
- 80vw --- 80% of the viewport width
- 1vmin --- the smaller value of 1vh and 1vw
- 1vmax --- the larger value of 1vh and 1vw
- 1em ---1 time the font size (or inherited font size)
- 1ex --- about halfthe font size
- 1ch --- 1 time the width of the character "0"
- 1rem --- 1 time the font size of the root element
There are some other length units that have not been widely implemented by browsers: cap, ic, lh, rlh, vb and vi.
The unit 'vmin' is a handy way of dealing with different screen orientations (portrait or landscape).
RESETRUNFULL
RESETRUNFULL
<!DOCTYPE html><html><body style="width:100%; height:100%;">
<div style="font-size:30vmin; width:5ch; background:orange;">
00000
</div>
</body></html>