Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

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

user-image
Question added by shweta tyagi , Specialist - Backend Development , taqnia
Date Posted: 2016/02/17
Muhammad Adeel Tahir
by 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