CSS Units. CSS has several different units for expressing a length. Many CSS properties take “length” values, such as width , margin , padding , font-size , etc.
What are CSS units?
What is 1em in CSS?
The em is simply the font size. In an element with a 2 in 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.