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

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

@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.

Thanks a lot James! You really illuminate me!

@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>

@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 :)

@Robert - You're quite welcome