CSS CSS Layout Basics Getting Started with CSS Layout Creating a Sticky Footer

Is it possible to change all percentage units to vh or vw? Any pros or cons?

I'm wondering is it possible to use vh, vw for the wrap, container? What's difference? Any pros and cons?

1 Answer

Steven Parker
Steven Parker
186,980 Points

Percentage units are relative to the size of the parent element, where screen-relative units (vw, vh) are based on the size of the display window. The choice would be about which reference you wish to use.

If the parent element takes up the entire window, there might be no noticeable difference between them.