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

Nelson Jimenez
Nelson Jimenez
3,475 Points

Why doesn't my CSS change the background color?

Hello everyone,

I am having problems with the workspaces. (1) I have linked my main.css to my html document. (2) I have placed the <link> tag that links my main.css after my normalize.css (3) I have applied the background color on the main.css file using the appropriate syntax. (4) I have saved both the index.html file and the main.css before reloading the preview page (5) Nothing happens after reload.

HTML file screenshot: http://imgur.com/XpvtDc0

CSS file screenshot: http://imgur.com/RA5CqxA

Screenshot of preview: http://imgur.com/Pucuniy

Why is that? Am I missing something?

Hi Nelson,

It looks correct to me. Have you tried simply copying your files to your local machine and seeing how they work in your browser? Sometimes I find workspaces to be a little wonky.

By the way, I appreciate your laying out the steps you took and what occurred as a result. Really great way to ask a question! :) Did you know you can simply copy-paste your code into your question as well? Check out the Markdown Cheatsheet link below the text box to see how.

3 Answers

Hi, Nelson Jimenez:

You can also quickly debug similarly written code on Codepen.io or http://www.sassmeister.com/.

I tried to navigate to the workspace to debug, but was unable to do so to give more precise answers unfortunately.

Nelson Jimenez
Nelson Jimenez
3,475 Points

Thank you everyone for all your replies. Everything is working fine now, I have no idea what happened but after endless attempts the preview just started working. I didn't change anything, I just refresh endlessly and then it worked. Thanks again. :)

Nelson Jimenez
Nelson Jimenez
3,475 Points

Hello Cena Mayo,

I have considered moving all my files to my local machine and loading it to the browser. I am just being a little lazy but will if the problem persists. I didn't know about the markdown option, as you may be able to tell based on my points so far, I am new to this site and it is wonderful. You may be right about the workspaces being a little wonky and that is a downside but the value is still marvelous. I appreciate your feedback as I try my best to provide as much information as I can whenever I am faced with difficulties.

Thanks again and I will consider your suggestions for future references.

:)

That's a strange error, I see nothing wrong with your code that would be causing this issue. Have you tried adding more CSS properties to see if anything changes?