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

What is the difference between px and %?

12th Aug 2016, 9:45 AM
Praneetha Bonala
Praneetha Bonala - avatar
2 Answers
+ 3
suppose your code is <hr width="50px"/> <hr width="50%"/> The first horizontal line will have a length of 50px. Where as second line's width will depend upon the device on which the page is viewed. suppose u are viewing the page on a phone with 300 px width, the width of our second line will be 50% of 300 i.e 150px. Likewise on 800px display it will be 400px. Am I clear?!
20th Aug 2016, 10:01 AM
Sreejith S
Sreejith S - avatar
0
Different ways to measure. Pixal- a minute area of illumination on a display screen, one of many from which an image is composed. Percentage- any proportion or share in relation to a whole
4th Nov 2016, 5:26 AM
Eugene K
Eugene K - avatar