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

Float left

My pictures are not falling into 2 collumns like I want them to but rather just moving to the left side. Here is my code.

/******************
General
******************/

body {
font-family: 'Open sans', sans-serif;
}

a {
text-decoration: none;
}



img {
max-width: 100%;
}

/***************
Heading
***************/

header {
margin: 0 0 30px 0;
  padding: 5px 0 0 0;
  width: 100%;
}


a {
text-decoration: none;
}

a {
text-decoration: none;
}

#logo {
text-align:center;
  margin: -5px;
}

h1 {
font-family: 'Changa one', sans-serif;
  margin: 15px 0px;
  font-size: 1.75em;
  font-weight: normal;
  line-height: 0.8em;
  padding: 0px;
}

h2{
font-size: 0.75em;
  margin: -5px 0px 0px;
  font-weight: normal;

}

/******************
Navigation
******************/

nav {
text-align: center;
  padding: 3px 0;
  margin: 10px 0 0;
  background-color: #599a68;
  color: #A1A1A1;
}

nav a, nav a:visited {
  color: #ffffff;
   text-align:center;
}

nav a.selected, nav a:hover {
color: #003300;
text-align:center;
}

nav li {
display:inline-block;
  text-align:center;
}

/******************
Footer
******************/

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

}


/******************
Page: Portfolio
******************/
#gallery {
  margin: 0;
  padding: 0;
  list-style: none;
}


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





/**********************
Colors
**********************/

/*****
site body
******/

a{
color: #6ab47b;
   text-align: center;
}

header {
background: #6ab47b;
  border-color: #599a68;
}

h1, h2{
color: #fff;
}


body{
background-color: #fff;
  color: #999;
}

the gallery section is the spot with the Float left code.

2 Answers

The css looks ok. In your html did you use id or class for gallery? Your css is for id

id