Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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