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


Felipe Henao
Felipe Henao
2,563 Points

problems with media queries

/*media queries*/

@media screen and (max-width: 705px){
    .grid_6 {
#love-at-first-bite img { 
             display : none;

6 Answers

is love-at-first-bite a class or id selector?

here's how it should look as a class selector

.love-at-first-bite { }

and as an id selector:

#love-at-first-bite { }
Felipe Henao
Felipe Henao
2,563 Points

I tried both and it dosen't work ...... love-at-first-bit is a image from html and in my html is like that :

<div class="grid_2 omega"> <img src="img/love-at-first-bite.gif" alt="Love at First Bite"> </div>

and in my css i want to hide this image with this code :

@media screen and (max-width: 705px){ .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6 { width:100%; } .love-at-first-bite { display:none; } }

because my task ask me for this :

Add the appropriate CSS within the same media query that will force the “love at first bite” illustration to disappear.

Dan Gorgone
Dan Gorgone
Treehouse Guest Teacher

The answer may be to apply the "display: none" property to img, which would apply it to all img I realize, but it's worth a shot in this case.

Has the class "love-at-first-bite" been applied to the img tag in the HTML?

Felipe Henao
Felipe Henao
2,563 Points

yes i have apply it .