DEV Community

Discussion on: Most Common CSS Units Of Measure Explained

Collapse
 
juniusfree1 profile image
juniusfree

When do you use a specific measure over the others? Thanks!

Collapse
 
flippedcoding profile image
Milecia

A lot of it comes down to preference, but usually percentages are used for block level elements like <div>.

If you need something that's a fixed size you'd probably go with px.

The others are just a toss up.

Collapse
 
email_vijayr profile image
Vijayr • Edited

I guess vh and vw measures will be more helpful because it adjust based on screen size. But yes, each measure have it's own importance.