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.

HTML How to Make a Website CSS: Cascading Style Sheets Use ID Selectors

My background color is not changing to orange.

I have checked the syntax. My main.css file is inside css folder, and I have also properly included it in the index.html file. But, still it isn't working. Here're the codes: Index.html code which is inside header tag: <link rel="stylesheet" href="css/main.css"> main.css code: body { background-color: orange; }

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

Hi there! Before we troubleshoot this further let's check some basics. Are you positive you saved your file? If so, try launching the preview again and refreshing the page. If this doesn't work, try clearing your browser cache or launching it in a private tab and refresh the page. If none of these work we're likely going to need to see a snapshot so we can assist you further! :sparkles:

edited for additional note

You say your link is inside the header tag. It should be inside the <head> tag. Note that <header> and <head> are not the same.

2 Answers

Steven Parker
Steven Parker
218,528 Points

Check your file organization.

In addition to Jennifer's suggestions, you might want to check how your files are organized. Your link tag indicates that your CSS file is named main.css and located in a subfolder named "css". If you have the file in the same folder as your HTML, then it would not be recognized and loaded.

Actually, it might be a server issue. I've fixed it now.

I actually moved the main.css file out from the css folder, then placed it back, and now it's working fine.