Pixels vs REM vs EM: Breaking down CSS Sizesby@introvertedbot
1,838 reads

Pixels vs REM vs EM: Breaking down CSS Sizes

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Pixels are one of the most known units of measurement in CSS. REM is used to set font size based on the font size of the root element. Em is similar to px or rem or em. Pixels can be divided by 10 to get an equivalent value of px in rem. Em em is similar but there's a key difference and I'll show you how these 3 units perform differently with a basic example. To keep accessibility, you need to set the. root element's font size as. 62.5% and it's done.

Company Mentioned

Mention Thumbnail
featured image - Pixels vs REM vs EM: Breaking down CSS Sizes
Sahil HackerNoon profile picture

@introvertedbot

Sahil


Receive Stories from @introvertedbot

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!