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 Styling Web Pages and Navigation Style the Portfolio

Images are not lining up in 2 columns using float code

images are not lining up in 2 columns; what am I missing? https://w.trhou.se/45heac4vzh

#gallery {
  margin: 0;
  padding: 0;
  list-style: none;

#gallery l1 {
  float: left;
  width: 45%;
  margin: 2.5%;
  background-color: #f5f5f5;
  color: #bdc3c7;

[MOD: edited code block]

1 Answer

nico dev
nico dev
20,364 Points

Hi Mike Sharp ,

Thank you for sharing a snapshot of your Workspace! That helps a lot to debug it.

Looks like you accidentally typed #gallery l1 instead of #gallery li. That in itself should do the trick.

Additionally, something that's not giving you problems yet, but will do as soon as you create the other pages is that you wrongly typed the closing tag for the last of the pages. That is, this one:

<li><a href="index.html" class="selected">Portfolio</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact<a/></li> <!-- In this one, the closing <a> tag 
should have the slash before the a, otherwise it will give you trouble later 
when you link to the Contact page -->

Thank you very much Nico!

nico dev
nico dev
20,364 Points

Glad it helped, Mike! :)

Feel free to check-in again should any other doubt arise later... I know I do!