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

Implementing Media Queries Challenge

I'm having an issue passing the challenge, "Add the appropriate CSS code to the CSS to make images scale with the fluid layout." in the Code Challenge: Implementing Media Queries.

I've added img { width: 100%;} within the media query, and even tried it with the class cupcake, menu, or even the container id preceding it. Is there something else to it? The website seems to be scaling perfectly while the challenge tells me it's not scaling. I've tried on both Safari and Chrome so far. I've also tried max-width: 100%, but still nothing. Thanks in advance, guys.

I am new to treehouse and web design. I have been studying for the past couple of weeks and I am having a very difficult time with this entire section. I have watched over and over the video and I can't seem to get a grip on it. It just isn't making sense to me. Please, any advice?

2 Answers

J.T. Gralka
J.T. Gralka
20,126 Points

Alejandro,

Remember that you want the minimum (or maximum) size of your images to scale. Try using the max-width attribute instead of just width, and make sure your img rule is correct to being with.

I hope that helps!

Best,

J.T.

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Alejandro,

That is correct, but you need to add the width declaration to the existing img rule. You don't need to add it in the media query just yet.