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

how can you pass task 3 on implementing media quiries?

Need help

5 Answers

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hi Homero,

You'll need to hide any image nested inside ".cupcake" when the browser width is 480px or less.

So first, locate the media query in the style section, then create a new rule inside of it using a selector that targets images that are descendants of ".cupcake". You'll then need to use a certain property that will no longer display the image.

James Barnett
James Barnett
39,199 Points

@Homero - What have you tried so far?

If you are still having issues after trying @Guil's hint, then please post your code to the forum.

Remember to indent each line of code 4 spaces so it will be properly formatted by the forum.

Here are a few suggestions on how to ask better questions on the forum.

My whole class has been trying this, and no one has been able to do it correctly.

We used

.cupcake-img {display:none;}

inside of the media query. I think the issue is the .cupcake-img, that doesn't seem right to me.

Ok- nevermind: I fixed it for Oscar and the other 19 kids having trouble. We had 20 people who all looked at this problem and couldn't figure it out because we weren't remembering our basics on selectors. I knew the .cupcake-img was wrong (but that is the way the video shows it, which is why I guessed it was the format)

Using

.cupcake img {display:none;} works for this one, and for another one later on.

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hi Derrick,

Your suspicions are correct :)

You are targeting the right elements. But make sure that your selector is a descendant selector. HINT: it should use whitespace as its combinator.

James Barnett
James Barnett
39,199 Points

@Derrick - There's no guarantee the video and the code challenge use the exact same names. So don't get overly hung up on what is typed in the videos.

Instead save your concentration for carefully reading the instructions of the code challenge step.