H
H
htmlclassic2021-08-22 20:06:52
css
htmlclassic, 2021-08-22 20:06:52

Where to write font-size if rem will be used?

Let's say the document's font is 24px. For other elements, I want to set the font relative to these 24px.
According to the classics or whatever else they wrote best practice, as I understand it, the font size and so on are written in the body.

In my case, for rem to work, I have to write font-size: 24px in html.
Is it ok or not?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel-ww, 2021-08-22
@Pavel-ww

html, body {
 font-size: 24px;
}

A
asmodeus13th, 2021-08-22
@asmodeus13th

html {
  font-size: [значение в px];
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question