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

Development Tools Web Accessibility Compliance Mobile Accessibility Relative Units

Relative Units

Hey!

Since I have started learning front-end, I was always told (or recommended) to use EM or REM, instead of pixels, but now the VH appears in my life..! which somehow looks like a better idea as it would avoid so many changes on @media queries? I just need some advise from some experience person (like you Steven Parker ). Would it be a better idea to use VH instead of EM, REM or %? or better to avoid them as it is not supported by old browsers?

Thank you :)

3 Answers

Steven Parker
Steven Parker
229,732 Points

:bookmark: Hi, I got alerted by your tag.

I don't think any of those units would be a problem in most browsers, but they are used for different things.

I wouldn't use vh as a substitute for em, but it might be a good alternative to % in some situations. Choose what fits your needs.

Steven Parker
Steven Parker
229,732 Points

I appreciate the confidence but since lots of folks are willing to help you might try not tagging anyone specific until the question has been posted for a day.

No worries, won't tag you anymore, thanks anyway.

Steven Parker
Steven Parker
229,732 Points

Just to be clear, I don't mind being tagged (it's kind of flattering! :blush:), I was only suggesting that you might give the whole community a chance first.

Sometimes I might just happen to respond first anyway.

I usually do, but not too many people bother to get involved and I end up with questions never answered. If it is a question regarding code or whatever, I leave the question open up for everyone, but something like this, which I was purely asking for a 'professional' advise, I rather get a straight response from someone I know is gonna respond correctly. Have a good one.

Steven Parker
Steven Parker
229,732 Points

Well, now that I know how you consciously you make that choice, I'm doubly flattered. Feel free to tag me anytime. :wink: