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

Attribute selector - stuck!

I am trying to work through the code challenge: "more selectors" and I can't get passed the question "Use an attribute selector to select the <a> element with the 'title' attribute. Give it a color property with a value of red. I've tried a few things like: a[class~="title"]{color: #FF0000} or a[href~="title"]{color: #FF0000} and so on and I can't get it to work and I can't figure out what I am doing wrong? any suggestions would be GREATLY appreciated!

2 Answers

Yes, you are close. As mentioned, title is an attribute. In your examples your looking for a class of title and an href of title. Instead you just want to find an element with the attribute title.

Maybe this will help you: http://css-tricks.com/attribute-selectors/

Thank you Kevin! I think I understand it now.

You're on the right track. I think the question could be worded better. Go into the HTML and find the anchor tag with the title attribute and take note of what the title is. Remember that title is the attribute. The solutions you tried you have title as the value of the attribute you are searching for.

Thanks Colin! I found more videos and I think I have a better handle on it!