width = "50" and "50%" are the same or not, and why ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

width = "50" and "50%" are the same or not, and why ?

9th Jan 2018, 9:30 AM
Filip Kovacevic
Filip Kovacevic - avatar
3 Answers
+ 5
If you don't precise the percentage, it by default uses the pixel units 50px and 50% are completely different, the most important difference you should remind is that px looks fixed to the user whereas % keeps scaled as the user resize his browser
9th Jan 2018, 9:38 AM
Dapper Mink
Dapper Mink - avatar
+ 1
Not. 50% is half and 50 will probably default to pixels and 50px is not the same and 50% (unless it's 50% of 100px; then it would be correct).
29th Jan 2018, 1:06 PM
Don't call me princess
Don't call me princess  - avatar
+ 1
*as
29th Jan 2018, 1:07 PM
Don't call me princess
Don't call me princess  - avatar