Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Felipe Henao
Felipe Henao
2,563 Points

problems with media queries

/*media queries*/

@media screen and (max-width: 705px){
    .grid_1,
    .grid_2,
    .grid_3,
    .grid_4,
    .grid_5,
    .grid_6 {
    width:100%;
    }
#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
STAFF
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 .