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

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.