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

General Discussion

Evans B. Ofori
PLUS
Evans B. Ofori
Courses Plus Student 13,720 Points

CSS Selector task 7/10

Is there anybody who could please explain the question below?

Add the class "important" to the CSS rules and make that class color red. Then add that class to the last paragraph.

8 Answers

James Barnett
James Barnett
39,199 Points

@Evans -

What the instructions are basically saying is ...

  1. Add a class named important to the HTML markup
  2. Create a CSS selector targeting the class important
  3. Create a CSS rule to style the text color as red for elements with the class important

If you're still having issues post your code here, and we see if we can point you in the right direction.

James Barnett
James Barnett
39,199 Points

@Evans - You're quite welcome

*html/

<h3 class="important">Hello World</h3>

*CSS/

p:last-child.important { color: red; }

This is wrong. I need help pls.

<h3 class="important">Hello World</h3>

James Barnett
James Barnett
39,199 Points

@Robert - You are over thinking this, don't need to use last-child.

Instead just add a class named important to your html, then style the class named important.

@James - thanks. I'm new in this :)

James Barnett
James Barnett
39,199 Points

@Robert - You're quite welcome