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

Dana Dulaney
Dana Dulaney
Front End Web Development Techdegree Graduate 22,797 Points

img[src^="product-"]{ border-color: lightblue; } hello I thought this was correct but says im not targeting img?

hello I am trying to complete this challenge but can't get passed this question...thought this was right? any suggestions? thank u!

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

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

3 Answers

You're not checking for product- in the src attribute. You're checking for "product-" at the beginning of the title attribute

img[title ^='product-']{
  border-color: lightblue;
}
Austin Whipple
Austin Whipple
28,189 Points

Nearly there on this one. That space after the attribute in the selector will likely cause problems.

Austin Whipple
Austin Whipple
28,189 Points

You're close! The question is asking you to target the images with title tags that start with "products-". Right now, you're targeting the image's src attribute.