Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What is the difference between px, rem and em font size in HTML ?

user-image
Question ajoutée par shweta tyagi , Specialist - Backend Development , taqnia
Date de publication: 2016/02/17
Muhammad Adeel Tahir
par Muhammad Adeel Tahir , Full Stack Engineer , Athr Real Estate

All are unit of length used to define size of elements.

px = Relative to the viewing device.

em = Relative to the font-size of the element (2em means 2 times the size of the current font).

rem = Relative to font-size of the root element.

 

The em and rem units are best in creating scalable layout.

 

More Questions Like This