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

Jacob Smith
Jacob Smith
10,926 Points

The icon .png files don't seem to be formatting to my css declarations. Confused.

When I went to add the icons for the phone, email, and twitter .png files and added css declarations to it it only cut off the pictures more. The icons are cut in half.

Liam Maclachlan
Liam Maclachlan
22,805 Points

Before seeing the code, I would say set the width of the images to 100%. Can you share your code? :)

Jacob Smith
Jacob Smith
10,926 Points

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

Liam Maclachlan
Liam Maclachlan
22,805 Points

Cool. Are you using a workspace man?

Jacob Smith
Jacob Smith
10,926 Points

Yes. Is there a way to share my code that I don't know about?

Liam Maclachlan
Liam Maclachlan
22,805 Points

i haven't done it yet, but I think you can copy and paste the link to share it

Liam Maclachlan
Liam Maclachlan
22,805 Points

Lol. Nope. On the workspaces there is a 'help' section. Moe info on sharing it should be there :)

Liam Maclachlan
Liam Maclachlan
22,805 Points

Found it. With the workspace open, click 'snapshot' at the top right :) Then share the link

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Jacob,

It's just a simple typo you have in your background-size declaration. You have a space between 20 and px.

.contact-info a {
  display: block;
  min-height: 20px;
  background-repeat: no-repeat;
  background-size: 20px 20px;            /* removed space on second 20px. */
  padding: 0 0 0 30px;
  margin: 0 0 10px;

Keep Coding! :)

Jacob Smith
Jacob Smith
10,926 Points

Haha Oh my goodness. Such an easy thing to overlook. Thank you Jason!!