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 Rem Units

Wouldn't there still be a compounding issue of we changed the font size of the root to more than 16px?

if add a snippet like this in our CSS file,

html { font-size: 2em; }

Then everything that has an em or rem value is relative to this defined size (of 2em in this case). Does this mean we never ever ever touch the root's font size and always leave it at 16px / 1em?

Gunhoo Yoon
Gunhoo Yoon
5,027 Points

If you want to make every single font larger, in other words if you want to scale your font-size equally then you surely don't want go over all font-size you've declared. But then why would you do something like that when user can easily scale up or down overall font-size through browser. I don't think it's something you should never do but I don't see great benefit in that either. It could be savior or destroyer depends on how the site is styled.

1 Answer

Hi Kalidh,

Using the root font size on the HTML element is a great way to scale the font sizes responsively. However you need to set the html elements font size in px.

This article on css tricks really changed how I coded my sites and boy what a difference. Putting the time in to understand this post will certainly change the way you code sites in respect of type.

This allows you to keep primary content more predominant and scale areas of the site individually!

Honestly super super helpful to me and have never looked back!

Craig