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 Unused CSS Stages Media Queries Adaptive Layouts with Media Queries

Matthew Whittington
Matthew Whittington
10,308 Points

Equation question

Where did you get the context and target values from?

2 Answers

Erik McClintock
Erik McClintock
45,783 Points

Matthew,

The context comes from whatever the base value is for any given item; i.e. how, most commonly, default font size is set to 16px. Target is whatever you ultimately want that item to be, so you create the value yourself.

Similarly, you can create an alternate context value, if you like. For example, you could create a rule for the entire page that sets the font-size property of p elements to 20px. That would change the context from being at the default of 16px to your custom 20px size. So, when you use the Target / Context equation after that, you would plug in your 20px for the Context.

Make sense?

Erik

Matthew Whittington
Matthew Whittington
10,308 Points

I'm just not sure where the number "width: 65.957446808511%;" came from in the exercise.

Erik McClintock
Erik McClintock
45,783 Points

Without rewatching the whole section, it's hard to tell for sure, but it looks like he's getting those values based on the golden ratio. When the screen is resized to a smaller width, he's setting the main content area to take up approximately 2/3 of the available screen space (i.e. the 65.blahblahblah% value) and the secondary content area to take up roughly the remaining 1/3 of the available space (i.e. the 31.blahblahblah% value). So, in this case, that golden rule ratio is seemingly where he's getting those values from.

Erik