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

James Ton
James Ton
1,100 Points

From what I understand, shouldn't this line of code be entered in responsive.css and not main.css which is shown here ?

I'm doing a coding challenge for media queries and from what I understand shouldn't this line of code:

@media screen and (min-width: 480px) {
     body {
     background: navy;
     }
}

be entered in its own stylesheet (responsive.css) and not as what's listed in the challenge (main.css).

Hi Victor,

Your comment here qualifies as an answer so you should re-post this as an answer.

4 Answers

Casey Antoine
PLUS
Casey Antoine
Courses Plus Student 5,174 Points

In the grand scheme of things you could actually put all of your CSS work into one big file and have it run just the same. The reasoning for having your code split up and grouped together is so that everything is easily readable and organized.

victor ollervidez
victor ollervidez
14,934 Points

HI there for this challenge it doesn't matter that it is being put into the main.css file simply because you only have that one file to work with for this challenge. In the future yes you can separate the style sheets as you please (e.x. "main.css", "responsive.css", "normalize.css").

Patrick Gerrits
Patrick Gerrits
14,614 Points

It does not matter. Maybe it would be neater to add it to the responsive.css (if it exists). But the filename does not matter. You can even name your css file "this-is-not-a-css-file.css" and it will still work as a CSS file.

James Ton
James Ton
1,100 Points

Thank you gentleman. I thought I picked up a mistake because when I copypasta that code into my workspace main.css it didn't work because I had it at the top of the .css document and forgot about the cascading nature of stylesheets.