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 CSS Foundations Getting Started with CSS Adding CSS to a Page

Stylesheet is not linking to HTML file

Hi -

I am attempting to get my stylesheeet using Treehouse Workspaces to work with my HTML file while following along in the "Adding CSS to a Page" video.

Here is what I have in my "index.html" file:

<!DOCTYPE html>
<html>
  <head>
    <title>Adding CSS</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">
  </head>

I have a CSS folder and inside this folder is my "style.css" file. In the video he does not use "type="text/css" inside his link brackets, but I saw on another discussion to do this. So, I tried adding it with no luck. I have been trying and retrying this using other programs on my computer (not Workspaces) and now on Workspaces with no luck. It is about to make me go crazy! I am using Firefox if this helps also.

Thanks!

Hi Raven, could you maybe zip the project and upload it to Dropbox for us?

3 Answers

I figured it out! It was a casing issue. I had labeled my file "CSS" but was putting "css" in my index.html file. When I corrected the casing, it is now working. Crazy how long you can spend on something and not have a clue that is so important.

I almost asked that! :smile: glad you got it.

Ronny Gudvangen
Ronny Gudvangen
4,685 Points

Have you tried using Chrome dev tools or just checking the rendered index.html file to see if the style sheet has the correct url? It's often easier to find wrong destinations/url's by checking out the source code. Hope that helps.

That is somewhat helpful, as it is definitely not linking me to the correct file. However, I still do not know what I am doing incorrectly :( From everything I can tell I have mine set up the same way he does in his video.

Ronny Gudvangen
Ronny Gudvangen
4,685 Points

Yeah, the linking is def. not working, but it could be numerous reasons for this. Without seeing all files and the directory - it's hard to fix. Perhaps adding the project files online for others to see, I'm sure the problem will be fixed quickly :)