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 How to Make a Website CSS: Cascading Style Sheets Use ID Selectors

My main.css file doesn't seem to be effecting my webpage (i.e. the background is not changing). What have I done wrong?

During Stage 4 of the CSS section of Front End Web Design, I am supposed to change the background color of my document to orange but it doesn't seem to be working. I believe all my pathways are correct but it's obvious that I have made a mistake somewhere.

Justin Horner
Justin Horner
Treehouse Guest Teacher

Hello Jon,

If you would please post your code so we can help you identify the problem. Check your link statement in your index.html page to make sure it is correct.

Thanks

1 Answer

Christina Giannouli
Christina Giannouli
18,202 Points

Hey Jon,

the path to your css file should look like this:

    <link rel="stylesheet" href="css/main.css">

Did you double check that the main.css is inside the css folder? Have you checked if you have properly closed all html tags in your document?

To change the background of the document you should do this:

body {
   background-color: orange;
}

Is there any chance you forgot to add the semicolon at the end of your code?