+ 2
how do pixels and % differ? is pixels an actual measurement and % how much of the area it takes up?
3 ответов
+ 3
Using pixels you only make your website for your own screen size. Using percentage it doesn't matter the size of the screen. I usually use percentage.
+ 2
think of it this way
If you have an area of 100 pixels, and you create an element that takes up 10 pixels, you'll be left with 90 pixels.
the same can be said with 10% of 100 pixels.
Now, if the total area was larger, let's say 500 pixels, the results would be a lot different.
10 pixels is always going to be that. the element won't increase in size...but...10% of 500 is going to result in a 50 pixel element.
Using % will also allow easier creation of responsive sites
0
the px reffer to masure from left top corner of area,but % reffer to masure from entire visual size of a screen. For ex: 10 px left it will consider 10 px from left side of area ( body or element block) ♧ 10 % it will masure the 100% of area and it will calculate and occupied only the 10 % of that area.