what is the diffrrence between px and%? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

what is the diffrrence between px and%?

28th May 2016, 9:13 AM
Aquib Shaikh
Aquib Shaikh - avatar
2 Answers
+ 4
px is the actual size in pixels while the % is the size depending of the parent element.
28th May 2016, 9:16 AM
Fredrik Mörtberg
+ 1
You will notice that % is USUALLY better when you change screen sizes. you should use % to make responsive designs. px means pixels. Keep in mind that different devices have different screen sizes. a laptop screen is usually smaller than a desktop.
7th Jun 2016, 5:14 AM
shaira
shaira - avatar