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

Sahil Kapoor
Sahil Kapoor
8,932 Points

I am not getting that what is wrong in my CSS rule.

The question is " 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[title ^= "product-"]{
  border-color: lightblue;
}

1 Answer

Manish Giri
Manish Giri
16,266 Points

I don't think you should have spaces in the selector. This worked for me - img[title^="product-"]{.

Sahil Kapoor
Sahil Kapoor
8,932 Points

Ya it worked thank you so much !