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 trialJonathan Vergara
589 PointsIs the code I wrote down the best way to solve my issue? Thanks for the help.
Below is a link to my original question https://teamtreehouse.com/community/my-elements-switch-back-and-forth-when-resizing-the-window-need-some-help-to-figure-it-out
The code below was my solution. @media screen and (min-width: 390px){
gallery li:nth-child(5n){
clear: left;
} }
@media screen and (min-width: 437px){
gallery li:nth-child(3n){
clear: left;
} } @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) {
clear:none;
}
gallery li:nth-child(4n)
{ clear: left; }
gallery li:nth-child(5n){
clear: none;
}
@media screen and (min-width:660px) {
}
1 Answer
Evan Agee
13,088 PointsThanks for your question. It would be most helpful if you could paste your code in a way that ensures it's formatted correctly. Currently we're seeing a mixture of code and regular text format.
Jonathan Vergara
589 PointsJonathan Vergara
589 PointsI am not sure how to paste what I have without it automatically turning into code and regular text. I tried pasting it as simple text but that doesn't work.