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!

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

Elizabeth Parham
Elizabeth Parham
4,170 Points

Targeting <a> elements with a title attribute

I am at the 'challenge' where it asks me to create an attribute selector that will target <a> elements with a title attribute and to give it a color property with the value darkred.

I am writing: ''' a [title] { color: darkred; } '''

It tells me it is incorrect. "Please check your attribute selector, make sure the color is set to darkred." Where am I going wrong?

3 Answers

Damian McCartney
Damian McCartney
4,067 Points

Remove the space from a and [title]..

a[title] {
       color: darkred;
}

See how that works..

Elizabeth Parham
Elizabeth Parham
4,170 Points

Hmm... I feel a little silly. That worked. Thanks!