R
R
Rooly2016-10-25 14:37:06
css
Rooly, 2016-10-25 14:37:06

What does 1em represent on an Html element in the DOM?

Hello.
I have such lines in reset.css (property excerpts)

html, body  {
  font-size: 100%;                     /* размер шрифта всем одинаковый */
}
body {
  font-size: 1em; /* используем безопасные шрифтовые CSS стеки */
}

Relative to what are 100% and 1em taken, because they do not have parents? Are these 100% and 1em different or the same for different browsers? body set to font-size: 100%, second time set to --- 1em. Isn't it the same thing?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kovalsky, 2016-11-09
@ZetIndex_Ram

from default [browser] styles

A
Alexander, 2016-10-25
@Palehin

It is generally accepted that 1em is equal to 16px

I
iBird Rose, 2016-10-25
@iiiBird

100% and 1em - yes. This is the same.
different browsers perceive differently.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question