Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Dan Williams
Dan Williams
5,339 Points

When is the right time to start using Viewport units: vw, vh, vmin, vmax ?

I understand that there is currently limited browser support for vw, vh, vmin, vmax.

However, saying that they work for the output browser my users view the site in, do they offer a more simple method to get around designing a more adaptive responsive web site?

From what I understand at the moment using ems and media queries etc lets you create a site that resizes on different devices and screen resolutions etc.

But these seem like an easier way to achieve this?

2 Answers

Kathleen Cook
Kathleen Cook
6,240 Points

If I were you, I would use whatever units I preferred, especially if they work in the browser you're designing for. If cross-browser support isn't an issue, go with the new units!

Matt Campbell
Matt Campbell
9,767 Points

Cross-browser support is IMPERATIVE. You are effectively righting off billions of potential visitors to your site by developing for only one browser that supports things others don't. The only time you can forget about browsers is like now with IE8 as it's finally dyeing out and Microsoft is stopping support for the OS it came with and probably the browser itself but I haven't verified.

You can look into shivs like modernizr.js to see if they support the new units. If so, they will help ensure cross-browser compatibility to take care of old browsers that never supported it.