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

Josh Myers
Josh Myers
3,203 Points

.css will not link to .html

Hello, I'm having some trouble getting my .css page to link to my .html page. I've restarted my browser, cleared the cache, saved/refreshed, tried modifying different selectors, switched the order of my rel and href...everything I could think of. Here is the code I have..any help??

index.html: <head> <meta charset="utf-8"> <title>Josh Myers | Developer</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head>

main.css: body {background-color: orange}

4 Answers

Kevin Korte
Kevin Korte
28,148 Points

Have you opened up your browser's development tools and confirmed it's able to find the css file? Usually these are do to mis-linked files.

Julien riera
Julien riera
14,665 Points

Have you specified the doctype ? (At the top of the index.html, you're supposed to have <!DOCTYPE html>)

Tanja Schmidt
Tanja Schmidt
11,798 Points

Hi Josh, besides checking your internal link to your css files (do you have them in an actually css-named folder?): Did you place a semicolon behind "orange" in your actual main.css file? Maybe that is why it appears as if your css files aren't linked?

body {
background-color: orange;
}

Hope this helps! :)

Josh Myers
Josh Myers
3,203 Points

I capitalized CSS in the directory and not in the file path....(face in palm, haha). Thanks everyone.