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

HTML How to Make a Website Adding Pages to a Website Add Iconography

Josh Myers
Josh Myers
3,203 Points

Unordered 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]

Josh Myers
Josh Myers
3,203 Points

I've actually discovered that none of the CSS changes I'm making are updating. For example, the list-style rule doesn't work either.

Ethan Rivas
Ethan Rivas
9,979 Points

Weird, you already try it changing the directory of your images?

Steven Parker
Steven Parker
231,248 Points

Do you always save your changes before refreshing your browser?

2 Answers

Kyle Johnson
Kyle Johnson
33,528 Points

In 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
Ethan Rivas
9,979 Points

I've tested the code of Josh and that works for me, maybe he's not saving his file.

Josh Myers
Josh Myers
3,203 Points

Hi Kyle, your suggestion fixed it. Thanks!