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

HTML

Adaptive Design Task 3 of 3

The task is "Add the appropriate CSS code to the media query so that images within the ".cupcake" div disappear when the device or browser width is at most 480px wide." and im not getting it to disappear.

@media screen and (max-width : 480px) { .contact{ width: 100%; } .menu{ width: 100%; } .cupcake{ display: none; }

4 Answers

Branko Veljkovic
Branko Veljkovic
6,684 Points

you are missing curly bracket at the end.

I did notice that after posting and it still doesnt help, I get the error

"The image is still visible even when the device width is less than 480px."

@media screen and (max-width : 480px) { .contact{ width: 100%; } .menu{ width: 100%; } .cupcake{ display: none; } }

Branko Veljkovic
Branko Veljkovic
6,684 Points

sorry, my mistake - didn't read your question carefully. So I just took the test, it says images with .cupcake class to disappear. So it would be: @media screen and (max-width : 480px) { .contact{ width: 100%; } .menu{ width: 100%; } .cupcake img{ display: none; } }

Esteban Ruseler
Esteban Ruseler
1,686 Points

Branko Veljkovic Thanks, I was stuck on this too. Like Graham I forgot the 'IMG' in .cupcake IMG. Cheers :)