

This unit is proportional to the root element's font size and is expressed as portions of 1, like em. It is said that "em" is the width of a capital "M" in the alphabet (roughly speaking, an "M" fits into a square). This unit is calculated the same way as percents, except that you compute in portions of 1 and not portions of 100. If no parent can be found, the default font size within the browser is considered as the base size for the calculation (usually the equivalent of 16 pixels). This unit tells your browser that an element's font size must be N% of the previous element whose font size was expressed. Relative units are expressed in em, % and rem: Percent-based sizes: % Relative units are friendlier to accessibility because they respect the settings on the user's system. Relative unitsĪlso called proportional units, relative units are computed relative to a parent element. Modern browsers get around this rule by pretending that you're asking for "16 pixels when the user sets a zoom factor of 100%". … you are telling the browser that whatever happens, the font size must be 16 pixels.
