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 Selectors Type Selectors

Linking CSS to HTML

Why does the instructor link his css file "css/style.css"?

When I do this it doesn't work but when I link mine "style.css" it does work...

It is in my CSS folder. Just seems like you wouldn't have to declare a root folder if they are both saved into the same one.

4 Answers

Sheina Yeheskel
Sheina Yeheskel
1,024 Points

Hi Ryan

What is going on here is getting you ready for later stages. For a really simple site you might have your style.css in the top folder with your index.html page.

When you start making more advanced sites or themes for Wordpress or working with Foundation/Bootstrap frameworks or just doing anything with Sass/Less you definitely will need that /css/ folder.

Thank you this is more of the answer I was looking for!

Felipe Barreto
PLUS
Felipe Barreto
Courses Plus Student 9,604 Points

take a look at where is your "style.css" stored at !!!

Hi Ryan,

If style file is in CSS folder, then we should to use right path - css/style.css. If not inside in CSS folder, then you can use just style.css. Depending on where your file located at.

    <link rel="stylesheet" href="css/style.css" />

or

    <link rel="stylesheet" href="style.css" />
Sheina Yeheskel
Sheina Yeheskel
1,024 Points

I know. This one took me a while to work out - in the School of Hard Knocks.

And you will need all this stuff for today's web market.