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 trialSteven Espin
3,012 Pointstargeting sub strings (code challenge)
not sure what is wrong with my code trying to target a image src starting with "product-".
this is the question: (code challenge)
Create a selector that targets an img element if its title value begins with "product-". Set the border color to lightblue.
img[src^="product-"] {
background-color: lightblue;
}
this is the error i get:
Bummer! Are you using a selector that targets 'img' elements with a title value beginning with 'product-'?
Steven Espin
3,012 Pointsi added the code and question asked
2 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Steven,
You're trying to match the src
attribute but it should be the title
attribute.
Also, it wants you to set the border-color
, not the background-color
Steven Espin
3,012 Pointsgot it to work. thanks, appreciate it.
SON VO
6,165 PointsHi Steven, The question is to add border-color not the background-color. U just need to change it to border-color and everything will be fine. Hope this helps!
Erik Cruz
9,772 PointsErik Cruz
9,772 PointsCan you post your code to see what the issue might be.