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.

HTML Build a Responsive Website Introduction to Responsive Web Design Converting Nested PX to EMs

Cipriano Mauricio
Cipriano Mauricio
3,560 Points

How do we determine the context?

In the previous example, we used 16 as browser default. Here we are using 24. How do we determine the context value? Thanks!

3 Answers

Hi Cipriano,

The task isn't using 24px as a browser default. It's using 24px because that's the size of the h1. Since the link is a child of the h1, 24px becomes the context for the link because it's parent is sized at 24px. If you made the font size of the link 1em then it would become 24px and match the font size of its parent.

The body font-size is still set at the default 16px.

I guess your referring to REM (Relative Em's) and font-sizes. So the context or base font-size is default at 16px, but it is what ever you set the body font-size to. So if you set

body {
  font-size: 32px;
}

Then 1em is 32px