CSS Values and Units Module Level 4

CSS Length Units

CSS Tricks

CSS properties often accept numeric values in the form of whole numbers, decimals, fractions or percentages. These determine the computed length or "distance" of an element. The CSS Values and Units Module Level 4 specification defines numerous different units for this purpose. Two main types of units are absolute and relative. Absolute units remain unchanged regardless of how other elements are sized, with the most common being the pixel value, which is based on screen resolution. Relative units are based on the size of something else, such as an element or the browser window. Uniting types include length, angle, time, frequency and resolution units. Units can also be left off, appearing as a single integer. However, this is mainly used for specifying details or when declaring “zero". Ultimately, the choice of unit depends on the specific context and requirements.

read full post