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 Selectors Going Further with Attribute Selectors and Pseudo-Classes Substring Matching Attribute Selectors Challenge

Marco Cerrato
Marco Cerrato
8,648 Points

I think that the challenge task 1 of 3 is not working. I have written the CSS code but I can't check my work.

I'm working on the first challenge and I have written down the CSS for the selector.

Here is my code:

img[title*="product-"] { border-color: lightblue; }

I'm always getting an error. I can't see the HTML.

style.css
/* Complete the challenge by writing CSS below */

img[title*="product-"] {
    border-color: lightblue;
}

3 Answers

Abe Layee
Abe Layee
8,378 Points

You're using the universal selector which is why you can't pass the challenge. The question is asking you to use the begin with selector ^. Make sure no space is between the img and brackets.

img[title^="product-"] {
    border-color: lightblue;
}
Marco Cerrato
Marco Cerrato
8,648 Points

Thank you for your answer. You are right. I was missing the ^ selector.

marcelo pereira
marcelo pereira
3,201 Points

Try replace the wildcart * for the selector ^ it should work now

Marco Cerrato
Marco Cerrato
8,648 Points

Thank you for your answer. You are right. I was missing the ^ selector.

Marco Cerrato
Marco Cerrato
8,648 Points

Thank you very much. You are both right. I was missing the ^ selector.