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

Matthew Alexander
Matthew Alexander
14,000 Points

main.css file not connected to index.html. I dont know why?? Help please?

My code doesn't work, the background color doesn't change nor does the changing of the underline.

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

the main.css is already inside the css folder

2 Answers

Erik McClintock
Erik McClintock
45,783 Points

Matthew,

Did you make certain that you've added the link tag to the header of your index.html file? Did you verify all the spelling, and that the path you used in your link tag is correct? Are you positive that you're loading the correct index.html file (i.e. If you have the project copied into two places, are you positive you're viewing your working version)?

Erik

Matthew Alexander
Matthew Alexander
14,000 Points

Erik

Thank you for helping me Erik, your help was appreciated. I have fixed the problem, I think it was a bug in workspaces. Since I retyped the charset="utf-8", retyped the same exact phrase. charset="utf-8". Suddenly the main.css file was connected to the index.html. Thank you once again for helping me. :)

Matthew

make sure in your head section you have your html layed out as

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

in front of the word link include <

Aslo make sure the html is not in the same folder as the css but in the same location e.g a folder called website in side the folder have index.html then a folder called css and a saved file as main.css

Matthew Alexander
Matthew Alexander
14,000 Points

I have fixed the problem, thank you for helping me. I think it was my browser that had the error.