Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!