CSS Units
Length and size values for many properties are set with CSS units.
Among the properties taking "length" values are font-size, width, margin, padding, border, and more.
Units fall into two types:
CSS Absolute Units
A length given in an absolute unit is fixed and appears exactly that size.
Screen size changes do not affect these units, which is why they are not recommended for websites. They can still help when the output medium is known, as in a print layout.
px (pixels) is the absolute unit used most.
CSS Relative Units
A relative unit measures a length against another length property, such as the parent element, the root element, or the viewport.
Because they scale better across different screen sizes, relative length units are ideal for responsive web design.
em and rem are the two relative units used most.
Tip: Scalable and responsive websites are exactly where em and rem shine!