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
Felipe Henao
2,563 PointsUse 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; }
Felipe Henao
2,563 PointsHi 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"
Felipe Henao
2,563 PointsI Got it, Thank you so much !
a[title]{ color: red; }
Guil Hernandez
Treehouse TeacherNice work, Felipe Henao !
1 Answer
Ram Ada
360 PointsI 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;
}
Guil Hernandez
Treehouse TeacherGuil Hernandez
Treehouse TeacherHi Felipe Henao,
You're close. All you need to include inside the square brackets is the attribute itself. Nothing else. :)