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!

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


Attribute selectors

Hi Guys,, I having an issue on one of the css topics. On the code challenge of CSS/ Basic Selectors – Part 2 they ask me for the following:

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

Html <h1>Lorem ipsum dolor sit</h1> <div> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc pulvinar consequat tortor, nec venenatis erat elementum scelerisque. Curabitur sit amet risus nisi. Aenean aliquet euismod augue at viverra. Ut varius arcu in <a href="#" title="foo">lorem iaculis ullamcorper</a>.</p> <h2>Donec tempor sodales</h2> <p>Sed tincidunt rutrum enim, vitae pharetra justo suscipit a. Nam eu egestas risus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam tempor, augue quis.</p> <a href="#" title="my_title">Donec eget lorem id nisi vehicula...</a> <p>Sed sit amet nulla elit, vel lacinia nisi. Donec eget lorem id nisi vehicula auctor id et dui. Etiam aliquet aliquet sem in rutrum. Cras posuere pharetra sem vitae egestas.</p> </div>

Here is my Css answer and is telling me is wrong. Any help please?

a[title]{ color: red; }


3 Answers

Your answer is correct. they have problem with the system. I made a quick example to verify check here http://cdpn.io/HludD That link is for full page this will be for the editor http://codepen.io/abhaysharma/pen/HludD

Hey Abhay. sorry I'm bothering you. I do have another small issue. Please read the following.

css > Text, Fonts and Lists > more propertiies Part 2

The test say: The link's container is set to hide its overflow and it's not allowing the text to wrap, so the link appears to be cut off. Select the paragraph with the class 'link' and set its text overflow to display an ellipsis.

My answer is:

p .link { text-overflow: ellipsis; }

and on the treehouse test screen it show an underline red under text-overflow. (like misspelling check)

I do press "check work" and I get thi: Bummer! Check the text-overflow declaration in your CSS.

Hello Carlos , I tried the challenge. I guess you are giviing space between p and .link since link is the class on p itself you don't have to add space

    text-overflow: ellipsis;

having space means the element within the p with class link.

Hi Abhay, Thanks so much for the tip!!!! I can't believe i can makes this kind of mistakes :( ITO WORKS NOW! YAY!!!

I really appreciate your help.

Jacob Scanlon
Jacob Scanlon
8,994 Points

Try not including the 'a' element. If I remember correctly the 'title' is not an anchor in that exercise.

Hi Jacob. Thanks for getting back to me. Well what you suggest is not working neither.
html: a href="#" title="my_title"

css [title]{ color: red; } Any clue please :) thanks so much

Thanks so much Abhay . I was getting crazy!! lol But listen to this I did use the att="" and it work. so I pass the test Whooo hoooo! Thanks a lot