Literal meaning of em?

“vw” means the “viewport width”.
What does it means by “em”?
What does it stand for?

I know the effect of em in css.
I like to know the literal meaning of “em”.

vw relates to the viewport width. It is a dynamic length unit which equals to 1/100 of the current viewport width. I guess you already knew that.

em is an in CSS common length unit equal to the type height of the font it is used with.

In CSS when used as the unit for line-height is when inherited equal to the font-size of the parent. For other properties it is equal to the font-size of the element itself (aka current font-size).

(A true dynamic line-height length in all instances would be the unit less number value that then is calculated from the current element’s font-size.)

Literally the em space originally described the width of the capital “M”. It is the name of a space character equal to the height of the font-size (in CSS escaped “\2003” or in HTML as the decimal entity &#8195).

The specs:
https://www.w3.org/Style/Examples/007/units.en.html

1 Like

“An em is a CSS unit that measures the size of a font, from the top of a font’s cap height to the bottom of its lowest descender. Originally, the em was equal to the width of the capital letter M, which is where its name originated.”

See this old thread for more info…

What does em mean?

2 Likes

em stands for emphemeral unit meaning it is relative to its current font size.

For example,

body { font-size: 24px; }
p { font-size: 0.5em; }

The font-size of the paragraph will be half times as big as the normal, body font. which is 12px.

No necessarily and just to clarify a little :slight_smile:

The font-size of the p element with be half as big as the font-size of its’ parent which may not necessarily be the body (but I know what you meant).

4 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.