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

Problem with icons not showing up on contact page.

My icons are not showing up on the contact page. I've checked over my code multiple times and compared to the code shown in the video. No difference unless I missed something. Any help is welcome!

9 Answers

Ethan Rivas
Ethan Rivas
9,979 Points

After all day, I have your solution! But, this is not gonna like to you haha, you just closed the unordered-list but left the list tags outside UPPS! It wasn't a CSS error it was a little error in your contact.html :p

  • Your code
<section id="secondary">
     <h3>Contact Details</h3>
     <ul class="contact-info"></ul>
     <li class="phone"><a href="tel:555-6425">555-6425</a></li>
     <li class="mail"><a href="mailto:micah@example.com">micah@example.com</a></li>
     <li class="twitter"><a href="http://twitter.com/intent/tweet?screen_name=parrotfish89">@parrotfish89</a></li>
</section>
  • Correction
<section id="secondary">
    <h3>Contact Details</h3>
    <ul class="contact-info">
       <li class="phone"><a href="tel:555-6425">555-6425</a></li>
       <li class="mail"><a href="mailto:micah@example.com">micah@example.com</a></li>
       <li class="twitter"><a href="http://twitter.com/intent/tweet?screen_name=parrotfish89">@parrotfish89</a></li>
    </ul>
</section>

this really helped thank you alot

Ethan Rivas
Ethan Rivas
9,979 Points

Can I see your code?

CSS (Contact page section):

/************** 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 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'); }

Corresponding HTML from Contact page:

<section> <h3>Contact Details</h3> <ul class="contact-info"></ul> <li class="phone"><a href="tel:555-6425">555-6425</a></li> <li class="mail"><a href="mailto:micah@example.com">micah@example.com</a></li> <li class="twitter"><a href="http://twitter.com/intent/tweet?screen_name=parrotfish89">@parrotfish89</a></li> </section>

Ethan Rivas
Ethan Rivas
9,979 Points

Micah Caffey Where are you storing your image files ?

Just under "all my files" in finder on my Mac. They show up on my sidebar in workspaces.

Ethan Rivas
Ethan Rivas
9,979 Points

Do you have your files in this order?

1) main project folder
  1.1) about.html
  1.2) contact.html
  1.3) img
    1.3.1) image files...
  1.4) css
     1.4.1) style.css
  1.5) index.html

Yes, though in my layout in the workspace sidebar the css folder is 1.3 and img files folder 1.4 (not sure that it matters)..

My arrangement:

1) Main project folder 1.1) about.html 1.2) contact.html 1.3) css (1.3.1) main.css (1.3.2) normalize.css (1.3.3) responsive.css 1.4) img files (1.4.3) mail.png (1.4.11) phone.png (1.4.13) twitter.png 1.5) index.html

Ethan Rivas
Ethan Rivas
9,979 Points

No it doesn't matter, I just order them like this because I wanted to see if you had the same folders and files where they have to be :).

In that case can you try if some of this css codes make it work?:

1)

.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'); }

2)

.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'); }

I tried both of these, and while gray bullets do show up next to the phone number, email and twitter addresses, the actual icons do not. I'm stumped!

Ethan Rivas
Ethan Rivas
9,979 Points

I'm really sorry for make you dance and didn't give you a correct answer before. I created a workspace and solved this, try my code, I'll wait your answer.

.contact-info a {
  display: block;
  min-height: 20px;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  padding: 0 0 0 30px;
}

.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'); 
}

edit: Image showing that the code works: http://imgur.com/a/IpEaz

No! No problem, and thank you for all of your help!

Unfortunately it is still not working for me (your above code was my original code as well). I am wondering if it has anything to do with anything i did before? But I have reviewed all my code and usually there is a greyed out portion if a bit of code is nonsensical, i think.

Code here:

http://imgur.com/VSQ1ZDk

Then on my page:

http://imgur.com/OFsz4Fb

Ethan Rivas
Ethan Rivas
9,979 Points

Upload your entire project folder to some service and paste here the link, I'll review all your code :)

Ah, yes! That was it, simple but costly mistake and the icons finally show up! Now my icons for some reason are on the opposite side of the page as my actual phone #, mail address and twitter handle, but I can probably follow up on this and find a fix. Thanks again!