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 CSS Foundations Selectors Basic Attribute Selectors

Not working!

isn't this the right code for the 1st task??

A[title] {color: darkred;}

2 Answers

I think a [id="title"]{color: darkred} is what you want.

No, it's asking for anchor elements with a title attribute, not anchors whose id is "title".

" a[title] {color: darkred;} " did work I just had to refresh the page something was wrong with the css page

You target anchor elements by using a lowercase a instead of uppercase, like this:

a[title] {
    color: darkred;
}

I don't think anchor elements are case sensitive.

thank you! I tried that once it didn't work but when I refreshed the page and wrote it again it worked, guess it was a bug

Wow, they're actually not. I really thought they were.

James Barnett
James Barnett
39,199 Points
    Just to double check I made a test case in codepen to double check CSS isn't case sensative.

http://codepen.io/jamesbarnett/pen/sfAty

Further reading:


> Although CSS is itself case-insensitive, class and ID names are defined to be case-sensitive in HTML 4.01

source: https://developer.mozilla.org/en-US/docs/Case_Sensitivity_in_class_and_id_Names


see also: http://xahlee.info/js/case_sensitivity_html5_xml_css_js.html

Thank you for the great resources, James!