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

My class won't fully implement?

In How To Build a Website, we add social icons in the HTML and format them in CSS, using the class social-icons. My class will only partially implement--the margins work, but the sizing won't. Does anyone know what I'm doing wrong?

The HTML:

<footer>
        <a href="http://twitter.com/ginanicoletta/" class="social-icon"><img src="img/twitter-wrap.png" alt="Twitter Logo"></a>
        <a href="http://facebook.com/gina.scalpone/" class="social-icon"><img src="img/facebook-wrap.png" alt="Facebook Logo"></a>
        <p>&copy; 2014 Gina Scalpone</p>
      </footer>```

The CSS
```css
.social-icon {
  width: 20px;
  height: 20px;
  margin: 0 5px ;
}```

2 Answers

Hi Gina,

The social-icon class should be applied to the img element and not to the link.

Try moving the class to the image and see if you get the right results.

Thanks!

You're welcome.

Hi Gina,

I see you are having an issue with sizing your images. Do you know which task this is so I could have a look?

I am not sure what the task is asking you to do with your code, but just from looking at the code you have pasted into your question I notice something. Personally, if I am trying to size an image, I place a class on the image directly, rather than on the link (a) tag. Try adding a class to the image and then in your css, refer to the image class to size the element. For example, something like this:

<footer> 
    <a href="http://twitter.com/ginanicoletta/">
        <img class="social-icon" src="img/twitter-wrap.png" alt="Twitter Logo">
    </a>
    <a href="http://facebook.com/gina.scalpone/">
        <img class="social-icon" src="img/facebook-wrap.png" alt="Facebook Logo">
    </a> 
    <p>&copy; 2014 Gina Scalpone</p> 
</footer>
.social-icon { width: 20px; height: 20px; margin: 0 5px }

Try something like this. This might not be what the task is asking you to do, but that is how I would personally go about sizing this element. You are trying to re-size the Image element (img) and not the Link element (a).

Good luck