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
Eric Read
2,222 PointsCSS linking problem!
Hey everyone!
I'm currently working on the "Type Selectors" video in the first CSS deep dive!
I'm following the code exactly as written in the video, but my CSS file is still not linking to the HTML when I look at it on my web browser (Google Chrome).
I have my index.html and style.css files in my "css" folder, and have this code written in my HTML:
<link rel="stylesheet" a href="css/style.css">
Any chance I am messing something up?!
Thanks, -e
Ricardo Hill-Henry
38,443 PointsCan you post some code so we can look at it?
Eric Read
2,222 Points <link rel="stylesheet" href="css/style.css">
```
3 Answers
Steve Suresh
13,185 PointsIf you have index.html and style.css in the same folder you should be able to be able reference style.css directly without using css/style.css path.
Stone Preston
42,016 Pointsthey arent in the same folder, he said hes got his stylesheet in a css folder.
Stone Preston
42,016 Pointsah wait it appears they are in the same folder. my bad
geoffrey
28,736 PointsYou stated " I have my index.html and the style.css files in my css folder. So I get they are BOTH in the css folder. If so, the path for the href isn't good as you typed it.
That should be done this way:
<link rel="stylesheet" href="style.css"/> <!-- no need to put css/ as you don't need to enter that folder, both are at the same place-->
Otherwise, It's not common practice to put the html files in the css folder. And the code you typed is good in that case in fact.
Eric Read
2,222 PointsAwesome! I redid everything completely from scratch and it seems to be working now!? But either way, this is super helpful!!
Eric Read
2,222 Pointsthe project name is CSS! The whole project is under that folder.
Stone Preston
42,016 Pointsah in that case try
<link rel="stylesheet" href="style.css">
Stone Preston
42,016 PointsStone Preston
42,016 PointsYou will have to use markdown to get code to show up in forum posts. there is a link to the markdown cheatsheet at the bottom right of the comment/post textbox