How does rem differ from em in CSS?

EMs are relative to their parent’s font size

REMs are relative to a base font-size

This is important when intermediate containers change font sizes. Child elements with EMs will be affected, those using REMs will not.

Leave a Comment