Line-height in rem on the html element does not react on font-size, why?

The bottom line is this. There is an html element

...

which is the root rem.

Rem depends on the font-size in html, but for some reason not in the html. So I think why?

html {
 font-size: 14px;
 line-height: 2rem; //32px
}


html {
 font-size: 15px;
 line-height: 2rem; //32px
}


I know that the default font-size in html is equal to 16px, but it is not clear why rem don't show up in my font-size is equal to another value.

What are your thoughts gentlemen?
June 14th 19 at 20:05
2 answers
June 14th 19 at 20:07
Solution
Because the rem value is relative to the root, which html not :)
:root is the html element =)

Actually the point is that if rem is specified for the root element for calculating the value is the initial value, which in most browsers is sixteen pixels that we see in the example of the author of the question. - Lulu_Zulauf71 commented on June 14th 19 at 20:10
thanks for the complement, and where there is more to read? Where such speculation? - Winona20 commented on June 14th 19 at 20:13
I not absolutely correctly expressed:
The pseudo-class :root defines the root element of the document. In HTML, this selector always matches the item , but a priority :the root is higher than that of the selector html.
(c)
Again: roughly speaking, when used in html {} it accesses the root element of the higher self, i.e. to itself) And there the default value of the font - standard browser, often 16рх ) - Nyasia_Dare commented on June 14th 19 at 20:16
means read about :root. Thank you very much! - Winona20 commented on June 14th 19 at 20:19
guesses? This is not conjecture, this is an excerpt from the html specification. Though not an exact quote, too lazy to look for it, I wrote from memory, but are transferred accurately. Look, accordingly, on the w3c site.

You have a tiny misleading. Or confusion. Expression but a priority :the root is higher than that of the selector html. not mean that above the html element in the markup there is something mythical. There's nothing there. It is written in relation to the styles and means only that the entry :root { color:red } would have a higher priority than html { color: green; }. To indicate they are one and the same element.
when used in html {} it accesses the root element of the higher self, i.e. to itself — then you will again enter your wording wrong. Right to describe what's happening is exactly as I wrote. And it's not the same.

Read the specifications, there are many interesting =)) - Lulu_Zulauf71 commented on June 14th 19 at 20:22
Not for that )

, "which is above the html element in the markup there is something mythical. There's nothing there. " - Read carefully the answer, that's what I wanted to convey)
And I wrote "roughly", just tried to explain on the fingers)
Here again is the specification, but two. Evidence of your words is not found :( - Nyasia_Dare commented on June 14th 19 at 20:25
located in the section about unit of measurement - Lulu_Zulauf71 commented on June 14th 19 at 20:28
June 14th 19 at 20:09
I read both articles from cover to cover, even with comments and there is no answer to my question. What You want to say in your own links? - Lulu_Zulauf71 commented on June 14th 19 at 20:12

Find more questions by tags HTML