+ 1
What is the difference between % and px?
3 Respostas
+ 3
The percentage value is relative to your screen size
a div with a 100% width would take the whole width of the screen regardless of the dimensions it is displayed on. (this is one way to achieve responsiveness)
a pixel value is specific and won't change if you change the display screen
+ 2
px is a unit of measurement for graphical objects and remains constant. however, % isn't and will change depending on screen height and width. %is flexible while pixel is fixed. If you develop a page only for phone, you will use px but for tablet, hand-held and pc you will use % that's where fixed and flexible CSS templates come into play.