Relative units are based on the size of something else, such as the default text size or the size of the parent element.
- em - The em is simply the font size. In an element with a 2in font, 1em thus means 2in. Expressing sizes, such as margins and paddings, in em means they are related to the font size, and if the user has a big font (e.g., on a big screen) or a small font (e.g., on a handheld device), the sizes will be in proportion. The default font size is usually 16px in most browsers. Traditionally, it's the width of a capital letter M. ✅
- ex - x-height, approximately the height of a lowercase x in the font.
- rem - root em, equal to the em size of the root element (html) (usually 16px). ✅
- ch - zero width, qual to the width of a zero (0) in the current font and size.
- vw - viewport width unit, equal to 1/100 of the current viewport (browser window) width. ✅
- vh - viewport height unit, equal to 1/100 of the current viewport (browser window) height. ✅
- vmin - viewport minimum unit, equal to the value of vw or vh, whichever is smaller.
- vmax - viewport maximum unit, equal to the value of vw or vh, whichever is larger.
Note: percentage (%) is not a unit, but they are also used, especially to ensure that page elements stay proportional. ✅
Further clarification: https://www.youtube.com/watch?v=_-aDOAMmDHI