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

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.

The relative and absolute section of the CSS Deep Dive is a little confusing to me and I'm having trouble with the last question of the Challenge. Thanks in advance to anyone willing to help.

post a link to the question so can have a look please

6 Answers

A rem unit is a bit like em but by using rem you always reference the actual font size that the browser starts with.

using em you can run into trouble if you have a lot of different font sizes in the same part of your code using em.

for example if you have a font set to 1.5em (24px) then later in the same code you could set a font size to 2em, you may think your setting 32px but you may end up with 48px (2x 1.5em)

rem solves this problem by always referencing the original font size specified by you or the browser default.

so 2.5em would be 2.5rem and 1.5em would be 1.5rem

and your base font size would simply be 1 rem

hope this helps.

Adam, why is it juts .more {font-size:1rem;} instead of .more a {font-size:1rem;} ? (since it asked to do it for links Thanks!

This is probably a stupid question but why is it that I do not need to use a .more {font-size: 1rem;} ? Why is the 'a' unnecessary?

As a .more will select all anchor links with the class more. And this is not what the question is asking

Thanks Sir :D

you just want to select the anchor element. This anchor element holds the "more" value the code wants you to change. i.e

a { font-size: 1rem; }

The question is

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.

Here is the html

<!DOCTYPE html> <html> <head> <title>Relative Length Units</title> <link rel="stylesheet" type="text/css" href="cc1-main-styles.css"> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div class="box"> <h1>Let's use Font-Relative Length Units</h1> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. <a class="more" href="#">Read more...</a> </p> </div> </body> </html>

Here is the css

h1 { font-size: 2.5em; }

p { font-size: 1.5em; }

I need the link to the ACTUAL quiz question so I may investigate what the problem is.

Thanks so what you need to look at doing is

.more { font-size: 1rem; }

rem stands for Root em. So as the question states to set .more to root size 1rem = the root size in the document in this case 16px.

Thanks, I wasn't putting the . before the more link. Thanks for your help Adam.

No worries Kenny Jones don't forget to choose the best answer when solved to close off the question and up vote if helped.