Should You Use Rem Or Em Units

preview_player
Показать описание

🌎 Find Me Here:

#Shorts
Рекомендации по теме
Комментарии
Автор

I always use EM inside components, so, if I change the font-size of this component's root, everything will proportionally change. This always work for me, as long as I define a font-size at the root of the component.

mus.igorfranco
Автор

When to use EM: Always. Except for the times you know you're independent of your inherited font size - that's where you use REMs.
When to use PX: border widths only.

Itay
Автор

And speaking of font size, you should always use relative units for that, like rem, em, or %, rather than absolute units like px or pt. That way, your site will respect any changes users may have made to the default font size in their browser settings.

Adamantium
Автор

Your videos are seriously always so good. As a beginner this is extremely informational. Thank you!

FAH
Автор

Kyle Bro!!
don't stop making these shorts...
these are really helpful..

abdullahtanveer
Автор

This was a great short. You managed to put very useful information regarding this topic in less than a minute. Thank you!

iceburger
Автор

Thanks so much Kyle for clearing that up 💙💙

CreativeTutorialsWeb
Автор

Im surprised by how well it is explained in just under a minute. thank you

twistedmetal
Автор

Thats me in the corner, that’s me in the spotlight loosing my position 😂

JosephCodette
Автор

Your videos are such good quick references

aroncanapa
Автор

Nice and concise. Almost like a very informational commercial!

castorcastorcastor
Автор

In general it is a better idea to use rem pretty much all the time. Your design feels more complete and strict if your sizing and spacing is based around an application-wide set of sizes that have one shared base. That's why most css libraries like tailwind, bootstrap, etc deliver sizes based on rem

froxx
Автор

It should be noted that changing the root font size is controversial because of browser font size settings.

etherweb
Автор

I know CSS, but I'm going to have to relearn it from scratch

CamaguNcoso
Автор

this guy is so good i cant follow his tutorials

babafemiolasunmade
Автор

Rem is useful with dimensions resizing with media queries

stefano
Автор

Had a dev insisting on em being the only thing to use. Changed font size for an element and the entire design fell apart. He still insisted em was the way to go and that we should've changed all the sizes, paddings and margins to accommodate this new element font size.

morphman
Автор

I was confused what you meant by current font size, but I googled it and it said it is the parent font size!

robertefremov
Автор

Life became easier when I started using rem.

bobdinitto
Автор

I still have no idea why we use either and when's what better. I always get confused and then just use px or vw/wh or %

BloodyScythe
visit shbcf.ru