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

Matt Campbell
Matt Campbell
9,767 Points

#intro-img div + selector doesn't work.

I'm getting super frustrated by something I can not work out to get to work.

Doing the responsive web design section and am at the point where we're removing items below 480px resolution.

Asked to use a div id and selector to remove an image from the div below 480px, and I can not get it to work.

I thought I was been thick, maybe I still am.

I can remove the image if I give the image the class of noShow and change the CSS to .noShow { display: none; } but if I use the code #intro-img or #intro img { display: none; } the image stays put.

However, if I use the code #intro { display: none; } the intro text goes away but the image remains.

The selector just doesn't select the img.

I've tried using sublime text 2 instead of my preferred dreamweaver in case it was a quirk of dreamweaver but no joy.

Searching the forums my code is identical as is the code from the video. I downloaded and checked the project files css but that code hides the text and keeps the image which I can do.

Anyone have any ideas? I can upload to codepen if that helps.

Would really really appreciate some light being shed on this as it is infuriating.

Thanks.

1 Answer

Matt Campbell
Matt Campbell
9,767 Points

Err yeah so, I sorted it. I found a rogue </div> tag putting the img into a different div so using the div identifier of course wasn't doing anything.

My bad.