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

Use an Attribute Selector to select the <a> element with the 'title' attribute. Give it a color property with a value of red.

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

Guil Hernandez
Guil Hernandez
Treehouse Teacher

Hi Felipe Henao,

You're close. All you need to include inside the square brackets is the attribute itself. Nothing else. :)

Hi Guil, the title attribute i found in HTML is "foo" I already put it in and nothing happened. the error is always "check your selector syntax"

I Got it, Thank you so much !

a[title]{ color: red; }

1 Answer

I think your error here is the [class~="title"] part. In CSS class selectors are represented with a period before the class name.

I believe your CSS should look like this:

a .title { 
    color: red;
}