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.

CSS CSS Foundations Values and Units Relative Length Units

Question about rem?

Select the link with the class more. Using the rem unit, set its font size back to the base font size of the root HTML element.

I have the following code

html { font-size: 100% }

.more a{ font-size: 1.0rem; }

I thought rem clears the previous css formatting and adjust the formating based on the highest attribute which in this case was html. By putting html at 100% i am asking to keep the fonts 100% of normal size. By putting the link font-size at 1.0 rem I thought i was telling CSS to match the normal font-size for the HTML. What I am I missing?

2 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

You don't need to set the HTML element's font-size to pass the challenge. Just leave that out. The main problem is your selector: .more a. This translates to "select an <a> tag inside another element with the class more. The challenge is asking you to select an <a> tag WITH the class more:

.more {
  font-size: 1rem;
}

or

a.more {
  font-size: 1rem;
} 

Thanks for the input. It really helps. I just completed the challenge.

I think you have illuminated a bigger issue I was a bit confused on. When to use "a.more" versus "more a"

So if the HTML would have read:

<div class="more"> <a href="#top">Top Page</a> </div>

Then the following CSS would work

.more a{ font-size: 1rem; }

But because the HTML was:

<a class="more" href="#top"> Top Page</a>

The a.more{ font-size: 1 rem;} is used in these situations.