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 Responsive Web Design and Testing Build a Three Column Layout

Jonathon Ouellette
Jonathon Ouellette
744 Points

[SOLVED] Three Column Layout works but Two Column does not.

So the Three Column Layout works but when I resize the browser window smaller the Two Column Layout doesn't kick in...I matched all my code to the video code so I'm not sure what's going on?

Garrett Sanderson
Garrett Sanderson
12,735 Points

Can you post your code so we can see what the problem might be.

Jonathon Ouellette
Jonathon Ouellette
744 Points

Here is the responsive CSS, the two column worked before adding the three column feature.

@media screen and (min-width: 480px) {

   /********************
    TWO COLUMN LAYOUT
  *********************/

  #primary {
    width: 50%;
    float: left;
  }

  #secondary {
    width: 40%;
    float: right;
  }

}


 /********************
    PAGE: PORTFOLIO
  *********************/

  #gallery li {
    width: 28.3333%;
}

#gallery li:nth-child(3n+1) {
  clear: left;
}



@media screen and (min-width: 660px) {

}
Wayne Priestley
Wayne Priestley
19,579 Points

Hi Jonathon,

I've edited your code so it appears correct in your post.

Here is a link to explain how to use Markdown to post your code How to post code

If you look at the bottom of the box when your typing a reply you will see Markdown Cheatsheet that will also explain how to post your code.

3 Answers

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Jonathon,

Try changing (min-width: 480px) to (max-width: 480px)

Jonathon Ouellette
Jonathon Ouellette
744 Points

That didn't do anything, in the lesson it has it as min.

Jonathon Ouellette
Jonathon Ouellette
744 Points

Figured it out, the 3 column width of 28.3333% was outside my 480px media query!

Shawn Flanigan
PLUS
Shawn Flanigan
Courses Plus Student 15,815 Points

Jonathon,

The CSS looks fine, as far as I can tell. Did you add the primary and secondary ids to your html? At around the 3:10 mark, Nick adds those ids to a few sections in contact.html, enabling the two-column layout for that page.