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

I'm having trouble answering a question I'm 90% sure I'm getting right, in the CSS Selectors Course.

The question in the CSS Selectors Course:

Next, create a new selector that targets an a element if its href value ends with ".html". Set its text-decoration to none.

My answer:

a[href&=".html"] { text-decoration: none; }

What am I doing wrong here?

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

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

a [href&=".html"] {
  text-decoration: none;
}

1 Answer

Maciej Kućmierowski
Maciej Kućmierowski
8,752 Points

You should use a $ sign in the href selector to select the ending part of the string.