Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Selectors Going Further with Attribute Selectors and Pseudo-Classes Substring Matching Attribute Selectors Challenge

I need help with a target selector?

Create a selector that targets an img element if its title value begins with "product-". Set the border color to lightblue.

/* Complete the challenge by writing CSS below */

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

You are trying to target the src or source of your image. The src should point to your image file in your HTML. Try replacing "src" with "title" if you are trying to find images with the title = product.

hope this helps Shaun

Thank you Steven but your answer is not working I have tried it exactly as the video indicated and without the dash and the dot. See my third post it has the exact way I have been putting this in.

Steven Parker
Steven Parker
216,810 Points

The challenges will never be something you can solve by pasting in the same code from the video follow-along. They may be similar but some part of it will be different. It's important to follow the instructions as given in the challenge.

I've been pointing out the specific things that need to be fixed to fit what the instructions are asking for (and to pass the challenge). You have re-asked this same question, but each time you still have not fixed the items I already pointed out.

1 Answer

Steven Parker
Steven Parker
216,810 Points

Here's a few hints:

  • the instructions say "title" but the attribute named here is "src"
  • the instructions say "begins with" but the symbol used here means "contains"
  • the instructions say "product-" but the string here is "product" (missing the "-" symbol)