Kevin Powell - CommunityKP-C
Kevin Powell - Communityโ€ข8mo agoโ€ข
6 replies
Faker

How to use em and rem

Hello, small question, I know the difference between rem and em with rem being based on font size of root element while em is based on font-size of current element.

The thing is whenever I use them, I use them interchangeably, like I don't really know where it would be better to use em or rem, just what came to my mind I put it there. The other thing is the value used together with them, I don't have a mental image of how big would my padding/size become.

For example, say I need a padding, I will just write something like : padding: 2rem, I don't really know how big 2rem is and if em would be more appropriate here.

Can someone elaborate on this please.
Was this page helpful?