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

General Discussion

Media 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

You are missing closing curly braces. One after "width: 100%;" rule and one after your "display: none;" It's ok, it happens to everyone.

Should be one more as well.

Ah, just what you said :)

yeah haha I realized there were two missing curly braces right after I posted. Thanks for the backup though :)

So 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;

}

}

Exactly!

Awesome thanks..

I'm still doing something off...

  /* Mobile ----------- */
    @media screen and (max-width : 480px) {
        .contact,
        .menu {
          width:100%;
        }

        .cupcake {display: none;
        }

    }

Thanks.

it still not working ?

Hi Simon, Yes.. This is the response I'm receiving. I've cleared the cache and all.. Thanks.

Maybe try set a background:black; on the body and minimize the window to see if it has effect

He Simon,

FYI it was

.cupcake img { display: none; }

Thanks for helping.

Ahh :) Good you get it to work