Q. What's the difference between these css codes? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Q. What's the difference between these css codes?

100vh 100% 100v 100%v 100%vh 100px What's the difference between all these above css codes, how do they affect the output? Which one is a better option?

24th Jul 2021, 4:22 AM
Shobhit :)
Shobhit :) - avatar
2 Answers
+ 3
100px - it defines the pixelated size of something... 100% - it defines the size by relating to others like, the device size is 1000 px and you do want to give style related to that of device size 1000px to 100%.. 100vh - it either defines the device viewport relative units... 100vh means to express 100%
24th Jul 2021, 4:39 AM
Musfirat Murshed
Musfirat Murshed - avatar
+ 2
100% is 100% width/height of its parent width/height. And 100vh is not means 100% unless its parent is 100vh height.
24th Jul 2021, 4:35 PM
Calviղ
Calviղ - avatar