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 trialJonathon 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?
Jonathon Ouellette
744 PointsHere 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
19,579 PointsHi 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
19,579 PointsHi Jonathon,
Try changing (min-width: 480px)
to (max-width: 480px)
Jonathon Ouellette
744 PointsThat didn't do anything, in the lesson it has it as min.
Jonathon Ouellette
744 PointsFigured it out, the 3 column width of 28.3333% was outside my 480px media query!
Wayne Priestley
19,579 PointsNice work figuring it out :)
Jonathon Ouellette
744 PointsThanks Wayne!! :)
Shawn Flanigan
Courses Plus Student 15,815 PointsJonathon,
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.
Garrett Sanderson
12,735 PointsGarrett Sanderson
12,735 PointsCan you post your code so we can see what the problem might be.