+ 1
What do you prefer using in Css pixels or percentages
4 Antworten
+ 2
Charlie Da stiles, Depends..
With boxOne inside boxTwo I use % for boxOne.
mostly for a single box I use pixels. Cause most of the times it is more precise.
/*
This should be a feed channel post instead of Q&A.
*/
+ 2
I want to agree with Vincent ... It's better to phrase questions more like, "When should I use pixels and when should I use percentages?" so it doesn't sounds like you're hosting a poll. Polls should be hosted in your personal feed, since popular opinion shouldn't sway your learning, but asking questions in earnest to clarify concepts and industry best practices can help your learning tremendously.
+ 2
Try use rm intead of px
+ 1
They are non comparable, pixels are a fixed measurement and should be used when you want the size of something to be absolute. Percents are relative and should be used when you want something to be responsive.
You should be comfortable using either when the situation calls for it along with em, rem and other units.
https://www.w3schools.com/cssref/css_units.asp