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

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

My code is wrong- any ideas what is the issue?

style.css
/* Complete the challenge by writing CSS below */
A [img='product-'] {

  border-color: lightblue;
}

2 Answers

Dane Andrade
Dane Andrade
9,977 Points

/* Complete the challenge by writing CSS below */

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

[attr^=value] Represents elements with an attribute name of attr whose value is prefixed (preceded) by value.

Conor Vanoystaeyen
Conor Vanoystaeyen
16,669 Points

I think is more in the line of

img[title='...'] {
    ...: ...;
}

Bet css is not my best subject.