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 CSS Foundations Selectors Basic Attribute Selectors

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

RE: 1st Challenge Task for the CSS "Selectors" tutorial

In the Challenge Task for the CSS "Selectors" tutorial, we are asked to "Create an attribute selector that will target <a> elements with a title attribute. Add a color property with the value darkred."

I tried

a [title] {
  color: darkred;
}
a [class="title"] {
  color: darkred;
}

and finally:

a [class=title] {
  color: darkred;
}

None of these worked (probably obviously...but I can't see what I'm missing!). What's the solution?

Thank you!

3 Answers

Hi Gina,

Your 1st one is what you want except you need to remove the space in the selector a[title]

With a space between the two you're creating a descendant selector.

Try without the space after the anchor element.

You're welcome