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

CSS

#intro and #intro-img both necessary to have them both disappear for 480px width?

I noticed in the exercise file that #intro is the only thing written in the @media screen section for hiding that section for small devices.

#intro, #about { display: none; }

This hides both the text and the image file when I open the index.html file provided in the exercise file.

Now in order for it to work with my files, I have to write:

#intro-img, #intro, #about { display: none; }

for both the text and image files to disappear when at 480px or lower. It won't hide the image if I just type #intro and it won't hide the text if I type @intro-img.

How come #intro in the exercise file takes care of hiding both the image and the text?

Thanks

1 Answer

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hi Christian,

In the project files, #intro-img is displayed none when the browser width is less than 1024px, so there's no need to hide it again at 480px. In your project files, make sure that you have:

#intro-img {
  display: none;
}

inside the @media screen and (max-width: 1024px) media query.

Hope this helps :)