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 trialJosh Myers
3,203 PointsUnordered List Icons Won't Appear
Hello, I'm having an issue getting the list icons to show up. I've reviewed my code several times, but I can't seem to find me error. My images are in the correct 'img' directory
HTML:
<section>
<h3>General Information</h3>
<p>I am not currently looking for new design work, but I am available for speaking gigs and similar engagements. If you have any questions, please don't hesitate to contact me!</p>
<p>Please only use phone contact for urgent inquiries. Otherwise, Twitter and email are the best way to reach me.</p>
</section>
<section>
<h3>Contact Details</h3>
<ul class="contact-info">
<li class="phone"><a href="tel:308-325-2329">308-325-2329</a></li>
<li class="mail"><a href="mailto:joshmyers92@gmail.com">joshmyers92@gmail.com</a></li>
<li class="twitter"><a href="http://twitter.com/intent/tweet?screen_name=joshmyers92">@joshmyers92</a></li>
</ul>
</section>
CSS:
/*****************************
PAGE: CONTACT
******************************/
.contact-info {
list-style: none;
padding: 0;
margin: 0;
font-size: 0.9em;
}
.contact-info a {
display:block;
min-height: 20px;
background-repeat: no-repeat;
background-size: 20px 20px;
padding: 0 0 0 30px;
margin: 0 0 10px;
}
.contact-info li.phone {
background-image: url('../img/phone.png');
}
.contact-info li.mail{
background-image: url('../img/mail.png');
}
.contact-info li.twitter{
background-image: url('../img/twitter.png');
}
[MOD: edited code blocks. sh]
Ethan Rivas
9,979 PointsWeird, you already try it changing the directory of your images?
Steven Parker
231,248 PointsDo you always save your changes before refreshing your browser?
2 Answers
Kyle Johnson
33,528 PointsIn Nick's code, he is targeting the a (anchor) element and you are targeting the li with class of phone. You need to add an 'a' after .contact-info li.phone.
It should look like this:
.contact-info li.phone a {
background-image: url('../img/phone.png');
}
.contact-info li.mail a {
background-image: url('../img/mail.png');
}
.contact-info li.twitter a {
background-image: url('../img/twitter.png');
}
Ethan Rivas
9,979 PointsI've tested the code of Josh and that works for me, maybe he's not saving his file.
Josh Myers
3,203 PointsHi Kyle, your suggestion fixed it. Thanks!
Josh Myers
3,203 PointsJosh Myers
3,203 PointsI've actually discovered that none of the CSS changes I'm making are updating. For example, the list-style rule doesn't work either.