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
Seems the font size displaying is 10px indeed but the dev tool misleading me. I will take this as the answer.
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.
Font size well display on Chrome dev tools: