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 Foundations Text, Fonts, and Lists List Styles

Michael Joyce
Michael Joyce
8,253 Points

Code Challenge Bug - Challenge Task 2 of 3

Add marker.png located inside the img folder as a background image to the list items.

The following CSS passes the check even though it is clearly incorrect.

ul {
  background: url(img/marker.png) no-repeat;
}

Why do you think the syntax is incorrect?

Michael Joyce
Michael Joyce
8,253 Points

The syntax is not incorrect. The fact that it passes the code challenge check is incorrect. It will add a background image to the list itself, not the list items.

The correct CSS to add a background image to the list items would be :

li {
  background: url(img/marker.png) no-repeat;
}

or

li {
  background-image: url(img/marker.png);
  background-repeat: no-repeat;
}

or

ul {
  list-style-image: url(img/marker.png);
}

Hi Michael,

You should email support about this.

2 Answers

Felix Yakubov
Felix Yakubov
17,475 Points

Its incorrect, there's no ' '

ul {
  background: url('img/marker.png') no-repeat 0 2px;
}
Michael Joyce
Michael Joyce
8,253 Points

Quotes are optional.

I'm not looking for help with solving the code challenge. Just pointing out that the CSS code in my original post should not pass the check as it is incorrect.