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
Marco Roman
5,527 PointsHelp: Code Challenge: "CSS Foundations" - "Code Selectors" #7/10
Hello, I am scratching my head with this one and a few Stellas haven't helped much, I would greatly appreciate any help with the following question:<emphasized> Add the class "important" to the CSS rules and make that class color red. Then add that class to the last paragraph.</emphasized>
I am stuck here and don't just want the answer please. I kept going back to Nick's vid and the last two minutes were crucial into answering this question, but I can't seem to nail this one, any help please? I had this code in mind
CSS:
p[class~="important"] {
color: red;
}
HTML:
<h3 class="important_headline">Hello World</h3>
<p>
Lorem ipsum...
</p>
3 Answers
samiff
31,206 PointsI think you're confusing this question with the last, or just reading the question a bit wrong. What 7/10 wants you to do is create an entirely new CSS rule (a new class named important). After making that new CSS rule, you want to go back over to your HTML file and apply the rule to the last paragraph. Don't want to give it away because I think you know how, but don't hesitate to ask for more help.
Jordan Warnholtz
3,705 PointsYou're thinking too much, you don't want the answer so I'll give you a few hints.
1) Your CSS needs to be simplified 2) "Important" will override previously defined colors 3) When creating CSS there's no need to type things like "class" or "id" within the document, when you do need to use them, you use their identifiers 4) Paragraphs don't require to be identified
Marco Roman
5,527 PointsYes you guys are right, I think I was simply over thinking this, I crammed so much info tonight that my head was all over the place. Thanks a lot guys!