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!

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 Foundations Values and Units Relative Length Units

I can't get past the rem question in the quiz. If the base font size is 1em, isn't the font-weight of the nested 1rem?

Or is there some math involved?

5 Answers

Devin Scheu
Devin Scheu
66,191 Points

Hey Mary,

Here is a step-by-step solution to this code challenge:

First select the h1 element, 16px is the default font size and 40px is the desired size. So do 40/16 and you should get a font-size property of 2.5em.

h1 {
  font-size: 2.5em;
}

Then, it asks you to make the paragraph have a font size of 24px. Since the default base size is 16px and the desired size is 24px you should do 24/16 which should give an answer of 1.5. Set this as your font-size property like so:

h1 {
  font-size: 2.5em;
}

p {
  font-size: 1.5em;
}

Finally it asks you to set the class more back to the base size of 16px using rem units. Remember that classes are selected with dot notation (so .more) and also that selecting it with the a element as a parent selector is redundant because there is only one .more class (I think this is where you went wrong) since rem is ROOT em it is based off of the default size which is 16px. So if you want to get 16px using the rem unit you would do 1 rem (because 1 times 16 is 16), so set 1rem as the font-size property.

h1 {
  font-size: 2.5em;
}

p {
  font-size: 1.5em;
}

.more {
  font-size: 1rem;
}

I hope that this helped you out!

Kind Regards, Devin

Devin Scheu
Devin Scheu
66,191 Points

Hey Mary, in order for me to help you I need to know the title of the quiz.

Relative Length Units in CSS Foundations

Thank you. I think I tried the anchor element alone, but not the class. I honestly thought I had tried that. I was trying lots of things and I swear, I watched the video so many times, I lost track.

Devin Scheu
Devin Scheu
66,191 Points

No problem I'm glad to help :)