To set the values of different CSS elements we use absolute and relative units. Relative units set the length regarding another property of the length.
The following relative lenth values can be determied:- em – font height
- ex – symbol X height
- px – pixels (related to the monitor screen resolution)
Length units em and ex are related to the font characteristics of the element itself, except characteristics font-size, for which we take the font characteristics of the parental element.
Units px (pixels) are related to the monitor screen resolution.
Relative size can be set in a percentage, usually comparing to the parental element value.
In this case after the value we put «%».
Absolute values are applied in case when we know in advance the parameters of the output.
- in – inches
- cm – centimetres
- mm – millimetres
- pt – points (1/72 inch)
- pc – pics (12 points)
Absolute values are seldom used in professional web design. The format of size does not suppose a strict use of the number symbol. If the symbol is absent, then the number is supposed to be positive. After the symbol if it is used, the number must follow it without any blank space, but it might have a decimal point. And then, again with no black space, a two-lettered abbreviation of the unit comes. If the size value is zero, the abbreviation may not be indicated.
Close