5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Use Rem, forget about em formulas.

Last updated at Posted at 2012-12-01

What is REM?

font size of the root element

Equal to the computed value of ‘font-size’ on the root element.
When specified on the ‘font-size’ property of the root element, the ‘rem’ units refer to the property's initial value.

html {
  font-size: 62.5%;
}

Now you've a base size of 62.5% to go.

If 62.5% is 10px, then:

you can use 1.6rem as 16px.

and don't bother with which context should I take into account, or whatsoever em & px's problems. Now you only refer to the size of html root element.

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?