What are the different measurements used in CSS to measure width, breath, etc | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What are the different measurements used in CSS to measure width, breath, etc

CSS measuremen

9th Oct 2022, 2:50 PM
Inioluwa Atanda
Inioluwa Atanda - avatar
8 Answers
+ 4
Inioluwa Atanda It depends on browsers width and height Means it will be different for each device depending on width and height for example 50vh = always 50% of viewport
9th Oct 2022, 5:40 PM
Sujal
Sujal - avatar
+ 5
Inioluwa Atanda vh means viewport height and vw means viewport width 1vw = 1% of viewport width For more information ℹ️ You can visit : [https://www.w3schools.com/cssref/css_units.asp]↗️
9th Oct 2022, 5:35 PM
Sujal
Sujal - avatar
+ 2
px, em, %
9th Oct 2022, 3:15 PM
Knight
Knight - avatar
+ 1
Thanks so much So how is it used??
9th Oct 2022, 5:37 PM
Inioluwa Atanda
Inioluwa Atanda - avatar
0
How is em diferent from px
9th Oct 2022, 4:39 PM
Inioluwa Atanda
Inioluwa Atanda - avatar
0
Pixel is a static measurement, while percent and EM are relative measurements. The size of an EM or percent depends on its parent. If the text size of body is 16 pixels, then 150% or 1.5 EM will be 24 pixels (1.5 * 16).
9th Oct 2022, 4:40 PM
Knight
Knight - avatar
0
Ok thanks How about vh?
9th Oct 2022, 4:42 PM
Inioluwa Atanda
Inioluwa Atanda - avatar
0
I know there is, but that's where my knowledge ends.
9th Oct 2022, 4:44 PM
Knight
Knight - avatar