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

Problem Linking CSS

My CSS works fine in the <head>, but when I use external CSS, it doesn't appear. Any help? I'm using Notepad++ and have checked and rewritten my code a million times, it is written correctly. Although I can provide it if necessary. Thanks. :)

Could you provide the <head> section of the <html>-code :) Without that, I can't notice what is going south on this one :)

3 Answers

I have had this problem several times. But here's what it should look like (Make sure that your CSS is in a css directory!)

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

Does it look something like that? If so, your program (Notepad++) is not working. Try using the Brackets Text Editor

Hey Nick,

Yeah, a code snippet would be helpful, but it's probably an issue with the location of your css file. Without seeing it, I would recommend double-checking the path you have to the css, and then whether you are referencing it relatively (href="css/main.js"), or from the root directory (href="/css/main.css"). If you aren't running a local server, then probably make sure you are doing a relative reference, without the leading "/", otherwise you would need to start at the computer's root directory (i.e. - C:/...).

Just a guess, but hope it helps.

I appreciate the replies guys, thanks! I got it fixed a couple of hours after I posted and forget about the post.