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

Jason Larkin
Jason Larkin
13,970 Points

Attribute selector

a [target="_title"]
          {
            color:darkred; }

I'm having trouble with this attribute selector challenge. The objective is to change the color of all <a> tags that have titles to dark red. I have tried everything and am out of ideas. Thanks in advance for any replies.

3 Answers

Jason Larkin
Jason Larkin
13,970 Points

Thanks Kevin, I did manage to solve it finally. I think it turned out to be the code that you wrote minus the "a". Thank you for the reply though!

Kevin Kenger
Kevin Kenger
32,834 Points

Hey Jason,

I'm not sure on this, but I think you can just target the attribute itself by only including the attribute's name.

Like this:

a[title] {
color: darkred;
}
James Barnett
James Barnett
39,199 Points

That will select any <a> element with a title attribute, that's overly specific, as the task requests any element that has a title attribute.

Jason Larkin
Jason Larkin
13,970 Points

Thanks James, I did finally get it right. Thanks for the reply.