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

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.

style.css
/* 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
231,198 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
231,198 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)