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

HTML Build a Responsive Website Adaptive Design Implementing Media Queries

Challenge task 1/3

There is no CSS file to add the CSS code to. I am supposed to put this in index.html?

3 Answers

Everything you're looking at is in style tags which is all CSS. Therefore, you can write the code into this challenge no problem like it's a stylesheet.css page. It's best practice to separate HTML and CSS in different files but it is not required. It's good to know how to do both.

for scaling images with fluid site i thought you just set max width to 100%

img { max-width: 100% margin: 2% 0; }

Yes, You're correct. I thought you were were asking if you write the code in index.html because there was no CSS file. (Which you will do in this challenge).

You can see the image styling is on the index.html file. If you make the max-width to 100% like you mentioned, you'll pass.

Just make sure you're using the correct syntax.

img {
    max-width: 100%;
    margin: 2% 0;
}