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
Seran Gee
1,014 PointsCode Challenge: Implement Media Queries (and a typo?)
I had a lot of trouble with part 1, but then I discovered that they forgot a semi-colon.
"@media screen and (max-width : 480px)"
Once I put in the semi-colon after 480px, it worked fine.
Now, I can't do part 2 though...
Add the appropriate CSS code to the media query so that ".contact" and ".menu" fill the entire container width when the device or browser width is at most 480px wide.
What I'm doing....
@media screen and (max-width : 480px;) {
.menu, .contact {
width: 100%;}
.cupcake img {width: 100%;}
}
What am I doing wrong???
3 Answers
Graham Davidson
Courses Plus Student 14,966 PointsHi there
You did not need the .cupcake img {width:100%} which I presume is in there from stage 1 - stage 1 only needed you to apply max-width:100% to the img in the CSS
Then for stage two this works
@media screen and (max-width : 480px) { .menu, .contact { width:100% } }
G
Seran Gee
1,014 PointsWow, thanks. I guess there was more than one way to solve Stage 1 and I did it wrong and that prevented me from doing stage 2!
Thanks!
Graham Davidson
Courses Plus Student 14,966 PointsNo worries Seran
Pleased I could help
G