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

Icons won’t resize, why?

Here is my code.

html

        <h3>Contact Details</h3>
        <ul class="contact-info">
          <li class="mail"><a href="jwluongo@gmail.com"><img src="img/mail.png" alt="Email Logo" class="e-mail button"> jwluongo@gmail.com</a></li>
          <li class="twitter"><a href="http://twitter.com/intent/tweet?screen_name=jwluongo"><img src="img/twitter.png" alt="Twitter button" class="social-icon">@jwluongo</a></li>
        </ul>

css

.contact-info {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9em;
  color: #081443;
}

.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.mail a {
    background-image: url('../img/mail.png')
}
contact-info li.twitter a {
    background-image: url('../img/twitter.png')
}

3 Answers

HEY, YOU SHOULD LISTEN TO THE INSTRUCTOR AND SOURCE THE IMAGE AS A BACKGROUND FROM CSS INSTEAD OF CALLING IT IN YOUR HTML TOO.

Mike Schaming
Mike Schaming
13,925 Points

Not sure if this would solve it, but it looks like you have a comment /**/ on your anchor styling that could be affecting it

was just tooling with margins/padding from the end of the video. Does not affect the presentation. Images still won't resize to fit container.

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Well, you're missing a period before two of your (the last two) contact-info info styles. Here's an example:

contact-info li.mail a  /* should be .contact-info */

just worked that out too :(. Half an hour to put 2 tiny pictures on the screen.

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Well the good news is that you're more likely to double check the periods before selecting a class next time! :)