Height 100px and width 100% are equal | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Height 100px and width 100% are equal

There are same

18th Jan 2020, 4:44 AM
Sanjeev Kumar
Sanjeev Kumar - avatar
3 Answers
+ 5
No...one is pixel the other is percentage of visibility https://kyleschaeffer.com/css-font-size-em-vs-px-vs-pt-vs-percent
18th Jan 2020, 4:49 AM
BroFar
BroFar - avatar
+ 3
Only if your screen is 100 pixels wide. 100% will be every pixel wide the webpage takes up, and 100px will just be 100 of the however many pixels wide your screen is
18th Jan 2020, 5:31 AM
Jax
Jax - avatar
+ 1
Block level elemens fill the width of their parent elements. So width 100% mean the total width of parent element. In case of <body> , it is width of the viewport
19th Jan 2020, 4:39 AM
Vikash Pal
Vikash Pal - avatar