skip to Main Content

I’m testing about set root font size to 62.5% then use rem for child element font size.

When I setup a div’s font size to 1rem, then I suppose the result should be 16 *0.625 *1=10. But the actual result is 12px. Then I setup another div which is 2rem, the result the 20px
which match with the equation 16 *0.625 *2 =20

I add a div with actual 10px too, but the result also 12px

Here is my playground setup:
https://playcode.io/1200950

Can someone explain why the 1rem div isn’t 10px?

2

Answers


  1. Chosen as BEST ANSWER

    enter image description here

    Seems the font size displaying is 10px indeed but the dev tool misleading me. I will take this as the answer.


  2. With your current setup it’s actually 10px, I added a 12px example to compare. I don’t know from where are you measuring but here is a good explanation of how it works. Hope it helps.

    Example

    Font size well display on Chrome dev tools:

    Font size

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search