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

Autumn Dlugoz
Autumn Dlugoz
239 Points

Why isn't my main.css file not working? It appears to be setup properly, but no changes save to site.

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Autumn | Website</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head>

Am I missing something here?

7 Answers

Hi. Check if you have the css file in the css folder, because it seems to work if it is there.

Lukas Muller
Lukas Muller
7,347 Points

Good idea, might be his problem :P

Scott Callaway
Scott Callaway
13,311 Points

Good shout. Didn't even think of this.

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Autumn. Welcome to Treehouse.

Are you refreshing the browser's page/tab where your preview is open. Saving changes in your file will not auto-update the preview in the browser.

I always close the window/tab where the preview is, so when you click on preview again, you will get a fresh and updated view.

Hope this helps. Keep Coding! :smiley:

Autumn Dlugoz
Autumn Dlugoz
239 Points

Tried this many times. Still not working.

Lukas Muller
Lukas Muller
7,347 Points

Hi! Is it inside of the <head></head> tag(s) ?

Autumn Dlugoz
Autumn Dlugoz
239 Points

It's inside of the head tags. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Autumn | Website</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head>

Autumn Dlugoz
Autumn Dlugoz
239 Points

It's inside of the head tags. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Autumn | Website</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head>

Scott Callaway
Scott Callaway
13,311 Points

Have you made sure that there aren't any errors within your stylesheet itself? The way that you are linking it seems to be fine... Have a look in your main.css for any bugs that could be preventing the content from being displayed properly.

Autumn Dlugoz
Autumn Dlugoz
239 Points

I've compared it to the example quite a few times and I don't see any differences. I could be overlooking something, but I don't see any errors. From what I can tell, it looks identical to the example in the video.

Well, this isn't an answer, but I'm having the same problem. I tried refreshing the page and everything, but still not working. Code seems to be correct. Please help!

https://w.trhou.se/hlq9j6jtls

You have a mistake in the rel attribute. It is not ref="stylesheet" - correct is rel="stylesheet", short from relation. Cheers

Thank you Nikolay, I see what you mean. It fixed my error! Thank you so much!

I am having the exact same issue. Checked and re-tried every suggestion listed here and still cannot get any changes to be made.

Hi Brent. Can you share you workspace so I can look better inside?

thanks

Eric Miller
Eric Miller
2,382 Points

I'm having this same issue. My workspace is perfectly identical. File is in the right place, name is correct, syntax is good, case is consistent. Do I have a browser setting that's not fully refreshing the page or something?

Scott Callaway
Scott Callaway
13,311 Points

Hi Eric,

Have you tried doing a complete refresh without cache in your browser? For instance, in Google Chrome (which I highly recommend using for the DevTools) you would use CTRL + F5 and that way, all of the content on your website would be refreshed.

Failing that, you could always just close the browser and press the "Preview" button at the top of Workspaces (if that is what you are using), in order to reload the content that you have created within the online environment.

Hope this helps!