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

Ryan Canty
PLUS
Ryan Canty
Courses Plus Student 5,665 Points

When linking css document I can usually write /foldername/filename.css and it links, for some reason today it won't work

Usually I just write <link rel="stylesheet" href="/folder-name/file-name.css"> and it works. but today it made me write <link rel="stylesheet" href="User/my-name/desktop/folder-name/file-name.css"> Its not really a problem, but it took me about an hour to figure out that I needed to write the WHOLE address. why has this suddenly changed on me? Im working on a new project so maybe its the way that I saved the folders.

1 Answer

Charles Wanjohi
Charles Wanjohi
9,235 Points

Remove the slash before folder name and try out again:-

<link rel="stylesheet" href="folder-name/file-name.css"> 

Am assuming the html file you are working on is located on the desktop as its the case with the folder holding your css files.If not so ensure the folder is in the same folder as your html file