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
Nathan Bentley
12,680 PointsCSS foundations > Selectors > CSS selectors final task at 7/10.
Hello, I am sure it is easy but I am stumped on this one....
I am in CSS foundations > Selectors > CSS selectors doing the final task at 7/10.
The question is...
Add the class "important" to the CSS rules and make that class color red. Then add that class to the last paragraph.
class="important" { color: red; background-color: white; }
can anyone advise me please? something to do with last paragraph?
4 Answers
Simon Lovelock
5,537 PointsHi Nathan,
New to this all too, but a little ahead on the learning adventure just now.
Remember to think about the CSS and HTML completely separate.
So in order to the "class" of "important" into the CSS file it would be:
.important{}
the "." representing the fact that it is a class and not an id (which would be #) and then the word important obviously representing it's name.
You would then place the appropriate code for colour within this rule. You seem to have that correct however you don't need to define the background-color also, if it doesn't ask.
The next step is simply to add the "important" class to the last paragraph <p> which you would do in the HTML file. This is the first part of the code you have above but it should follow the <p> tag in the HTML and not be in the CSS.
I hope that's clear, if not let me know, this is the first time i've tried to help someone.
Cheers,
Si.
Nathan Bentley
12,680 PointsCheers Si, I got it now. Thanks for the detailed instruction!
James Barnett
39,199 Points@Simon - Great explanation
Marcos Timana
5,638 PointsThank you Simon.