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 trialGinger Tech
Courses Plus Student 5,566 PointsHey, I cannot get past this code challenge. This is my code #gallery li { width: 28.3333%; }
Hey, I cannot get past this code challenge.
This is my code #gallery li { width: 28.3333%; }
I see nothing wrong with it at all...
@media screen and (min-width: 480px) {
#primary{
width: 50%;
float: left;
}
#secondary {
width: 40%;
float: right;
}
#gallery li {
width: 28.3333%;
}
#gallery li:nth-child(4n) {
clear: left;
}
.profile-photo {
float: left;
margin: 0 5% 80px 0;
}
}
@media screen and (min-width: 660px) {
nav {
background: none;
float: right;
font-size: 1.125em;
margin: 5%;
text-align: right;
width: 45%;
}
#logo {
float: left;
margin-left: 5%;
text-align: left;
width: 45;
}
h1 {
font-size: 2.5em:
}
h2 {
font-size: 0.825em;
margin-bottom: 20px;
}
header {
border-bottom: 5px solid #599a68;
margin-bottom: 60px;
}
}
4 Answers
Ginger Tech
Courses Plus Student 5,566 Pointsmanaged to fix it with this code if anyone has a problem.
@media screen and (min-width: 480px) {
#primary {
width: 50%;
float: left;
}
#secondary {
width: 40%;
float: right;
}
#gallery li {
width: 28.3333%;
}
#gallery li:nth-child(4n) {
clear: left;
}
.profile-photo {
float: left;
margin: 0 5% 80px 0;
}
}
@media screen and (min-width: 660px) {
nav {
background: none;
float: right;
font-size: 1.125em;
margin: 5%;
text-align: right;
width: 45%;
}
#logo {
float: left;
margin-left: 5%;
text-align: left;
width: 45;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 0.825em;
margin-bottom: 20px;
}
header {
border-bottom: 5px solid #599a68;
margin-bottom: 60px;
}
}
Fred Sites
11,151 PointsFor task one #gallery li {
width: 28.3333%;
}
works fine for me which looks identical to what you have. Which task are you stuck on? Make sure all your indentation is clean, sometimes the challenges will say its wrong for little indentation issues (I see a couple in the media query code).
Fred Sites
11,151 PointsThis code passed both tasks for me, the only difference I see is a couple spaces in your code that mine doesn't have. You also have another media query that I do not. I'm not sure where it came from, maybe they updated since I completed the track or you added it?
@media screen and (min-width: 480px) {
#gallery li {
width: 28.3333%;
}
#gallery li:nth-child(4n) {
clear: left;
}
}
Ginger Tech
Courses Plus Student 5,566 PointsCheers buddy, it was from when I was watching the tutorial, there was two media queries, one for 480px and for for above.
Ginger Tech
Courses Plus Student 5,566 PointsDoesn't work for task one :( @media screen and (min-width: 480px) { #gallery li { width: 28.3333%; }
#gallery li:nth-child(4n) { clear: left; }