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

charles bailey
seal-mask
.a{fill-rule:evenodd;}techdegree
charles bailey
Front End Web Development Techdegree Student 4,345 Points

Can't seem to select image properly in my css.

I am practicing css selectors with no id's or classes and I can't create an image selector. I've reviewed the video and have written my code just like Gill did. What a I missing?

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

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

border-color: lightblue; will not work on a img!

try using: img[src*="product-"] { outline: 5px solid lightblue; outline-offset: 2px; }

1 Answer

Amrit Pandey
Amrit Pandey
17,595 Points
/* Complete the challenge by writing CSS below */

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

Two mistakes, first it was title value! second(not a mistake actually) for begins with we use ^= instead of *=

charles bailey
seal-mask
.a{fill-rule:evenodd;}techdegree
charles bailey
Front End Web Development Techdegree Student 4,345 Points

Thank you! After much deliberation I realized why my answer was in correct. I now understand not to follow so closely to what the teacher is doing.