Em or rem? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Em or rem?

What is the difference between Em and Rem & which is the best choice?

14th Mar 2017, 7:32 AM
Rateb Ɩzil
Rateb Ɩzil - avatar
3 Respostas
+ 2
<div style="font-size:1.5em"> Some <div style="font-size:1.5em"> Text </div> </div> try it, and then change to rem
14th Mar 2017, 9:02 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
+ 2
When usingĀ emĀ units, the pixel value you end up with is a multiplication of the font size on the element being styled. When usingĀ remĀ units, the pixel size they translate to depends on the font size of the root element of the page, i.e. theĀ HTML element. That root font size is multiplied by whatever number youā€™re using with yourĀ remĀ unit.
19th Mar 2017, 7:55 AM
Simpson Chacko
Simpson Chacko - avatar
0
Hi
29th Mar 2023, 6:05 PM
Arman Nasrat
Arman Nasrat - avatar