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
Paula Viera
2,409 PointsMedia query trouble
From Building a responsive website:
Trying to make the cupcake disappear..
/* Mobile ----------- */
@media screen and (max-width : 480px) {
.contact,
.menu {
width:100%;
.cupcake {display: none;
}
11 Answers
Jose Morales-Mendizabal
19,175 PointsYou are missing closing curly braces. One after "width: 100%;" rule and one after your "display: none;" It's ok, it happens to everyone.
Joakim Nordlund
5,610 PointsAh, just what you said :)
Jose Morales-Mendizabal
19,175 Pointsyeah haha I realized there were two missing curly braces right after I posted. Thanks for the backup though :)
Paula Viera
2,409 PointsSo it would be.. one for the width, one for the cupcake and one for the media query?
/* Mobile ----------- */
@media screen and (max-width : 480px) {
.contact,
.menu {
width:100%;
}
.cupcake {display: none;
}
}
Jose Morales-Mendizabal
19,175 PointsExactly!
Paula Viera
2,409 PointsAwesome thanks..
Paula Viera
2,409 PointsI'm still doing something off...
/* Mobile ----------- */
@media screen and (max-width : 480px) {
.contact,
.menu {
width:100%;
}
.cupcake {display: none;
}
}
Thanks.
Simon Jensen
3,558 Pointsit still not working ?
Paula Viera
2,409 PointsHi Simon, Yes.. This is the response I'm receiving. I've cleared the cache and all.. Thanks.
Simon Jensen
3,558 PointsMaybe try set a background:black; on the body and minimize the window to see if it has effect
Paula Viera
2,409 PointsHe Simon,
FYI it was
.cupcake img { display: none; }
Thanks for helping.
Simon Jensen
3,558 PointsAhh :) Good you get it to work
Joakim Nordlund
5,610 PointsJoakim Nordlund
5,610 PointsShould be one more as well.