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

CSS How to Make a Website Styling Web Pages and Navigation Polish the Navigation and Footer

Elena Paraschiv
Elena Paraschiv
9,938 Points

Display the footer images(twitter+fb) inline as Nick

The footer images are not displaying inline, even if I tried the property display:inline-block. THey are instead display in a vertical line.

Html code:

<footer> <ul> <li><a href="https://twitter.com/"><img src="img/twitter-wrap.png" alt="Twitter" class="social-icon"></a></li> <li><a href="https://www.facebook.com/"><img src="img/facebook-wrap.png" alt="Facebook" class="social-icon" > </a></li>

</ul>
<p>&copy; 2015 Elena Paraschiv</p>

</footer>

CSS: footer{ font-size:0.75em; text-align: center; clear: both; padding-top: 50px; color: #ccc; }

.social-icon { width:20px; height:20px; margin: 0 5px; display: inline-block; }

1 Answer

The reason the images are displaying vertically is because they are inside

<li></li>

elements which by default will display vertically stacked. Add the display:inline-block to the

<li></li>

elements instead of the .social-icon element and that will get the images to display horizontally.

You could also use float:left instead of display:inline-block.