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!

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

Alex Weinberg
Alex Weinberg
2,726 Points

Having trouble getting marker.png to show up as a background item on li items.

Here is the HTML I'm working with,

<!DOCTYPE html> <html> <head> <title>Lists</title> <link rel="stylesheet" href="style.css" /> </head> <body> <h1>List Properties</h1> <ul> <li>Viverra rutrum orci lacinia iaculis mi per fermentum tortor malesuada</li> <li>Id aliquam nisi accumsan felis pretium enim arcu fames</li> <li>Eros mollis sociosqu condimentum lectus cursus pellentesque et laoreet</li> <li>Rhoncus donec vulputate malesuada euismod nunc conubia netus, ante eros</li> <li>Sodales ante duis semper nisi malesuada senectus, sed magna odio at egestas</li> </ul> <ol> <li>Iaculis porta erat turpis aptent vehicula metus sagittis eleifend ultrices diam maecenas habitasse</li> <li>Amet nulla aliquam urna faucibus blandit cras id vehicula faucibus, auctor vivamus mattis integer elementum scelerisque faucibus</li> <li>Duis nullam accumsan conubia auctor aliquam posuere nam tortor mollis a</li> <li>Duis at posuere rutrum fermentum est, nec ultrices sagittis amet torquent placerat, sit senectus vitae sem</li> <li>Amet platea facilisis pretium hendrerit nisi aenean curabitur iaculis dictumst, class mi lacus ullamcorper at odio ullamcorper curabitur</li> </ol> </body> </html>

And here's the css I wrote along with the video to include the png as a background image on the li items, but it's not showing up. Any suggestions?

ul li { background: url('marker.png') no repeat 0 2px; padding-left: 35px;

1 Answer

Hi Alex,

You are missing a hyphen from no-repeat which could be affecting the rest of the style, e.g:

ul li { background: url('marker.png') no repeat 0 2px; padding-left: 35px;}

would become:

ul li { background: url('marker.png') no-repeat 0 2px; padding-left: 35px;}

Depending on how you're styling them you may need to alter the display property too.

Hope that helps.