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 will not change to orange - I've checked my code several times now, still no joy!

Hello all,

My background won't change to orange, as it does in the video - I've checked my code repeatedly, and even deleted and recreated my main.css file, but the background still won't change colour to orange.

Please could I have some help? I'm not sure what I've missed here, but everything seems to be in order codewise - I've followed the video exactly so far.

Many thanks in advance

Can you make a snapshot? Here is one where the background changes to orange:

https://w.trhou.se/oupxxpjsxv

nakalkucing
nakalkucing
12,964 Points

Hi Henry Brenton! Would you mind posting your code? I'd like to look it over and see if I can help. Best - Nakal

Alexander Bourlotos
Alexander Bourlotos
4,009 Points

Double check your link tag and make sure it’s not a script tag.

Also, make sure the path of the file you’re linking is the same as what you’re putting in your HTML file.

Lastly, if you’re using any other css packages like bootstrap, try making sure that your custom css is the last link in your <head> section.

If none of that works then please post your code or a link to it. Thanks

Moved this from answers to comments!

3 Answers

Hi Henry,

You'd better check if there is # before the number, if you use one. Or maybe the fault isn't in that line, but the one above it. Like a ; or a } missing.

Happens to me a lot. Often as a result of copy/cut and paste. I've learned to recognise the symptoms, so I know where to look for the problem.

Good luck!

Gari Merrifield
Gari Merrifield
9,558 Points

Following along with the video, points Nick makes 1) include the link for the style sheet in your HTML page HEAD section, be sure that you have the file named correctly, and that the path matches. If you created the file, but didn't get it moved into the css folder, it won't be found if you told it to look in there ( as Nick did in the video )

2) be sure that you have correctly selected the body, it is just "body" not ".body" or "#body"

3) you may need to force a refresh in your browser This page seems to describe most of the ways you may need to use to force it : https://www.getfilecloud.com/blog/2015/03/tech-tip-how-to-do-hard-refresh-in-browsers

Hey everyone - thank you for all your help!

Newbie mistake - I named my css folder 'CSS' no 'css' lol

Best Regards

Henry

nakalkucing
nakalkucing
12,964 Points

Glad to hear you found it. :)

I'm not a newbie anymore, but I still make mistakes like that. Not so much in these courses, but I do in real life building websites. The trick is to recognise the symptoms, so you know where to look for the cause. And the best way to learn is to make many mistakes, so you remember them and their solutions next time! By now I love to make mistakes. And that was not the case when I started here. You sound much more relaxed about it. Good for you!

Good luck with your study! Johanna