DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Discussion on: Confused About rem and em units in CSS?

Collapse
 
devoskar profile image
Oskar Pietrucha

Correct me if I'm wrong, but the math behind 1em -> 16 px is valid only for the default browser's settings I believe. If user has changed the default fontSize the "1em" means a size equals to the default, normal font.

Collapse
 
joelbonetr profile image
JoelBonetR

That's correct and just what I come to say

Collapse
 
ali6nx404 profile image
Mahesh Patidar

That is my assumption because em totally depends on parents size so we can't say it depends on browser default because em uses closest parent size and the default is the last option for us.

Well your point also right if em is using browser size as a parent size.

Collapse
 
hamzatechpro profile image
HamzaTech-pro

It depends on parent font size