Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
231,269 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.