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 Basics (2014) Understanding Values and Units Em Units

Does default of 16px font-size automatically change depending on viewport resolution?

So if there are two screens, one having twice the resolution of the other, and the default font-size is 16px, will the screen with more resolution automatically double the default resolution (and with it the value of em units) as it does with other px units? Am I able to use relative units with the same effect across different size viewports with varying resolutions? I'll be happy with someone pointing to a site that discusses this in detail.

1 Answer

Hi Robert- It's a bit confusing as a pixel size has nothing to do with a real pixel on your screen. The font size will indeed react to the browser window size if you use Em. These two posts were helpful as I explored this:

https://css-tricks.com/why-ems/ https://css-tricks.com/viewport-sized-typography/

Best, Greg

thank you!