While learning about paths I found out that "/" takes you to the root directory. I made .html and .css files in the same directory to test how it behaves for different paths. When linking the css file, href = "app.css" and href = "./app.css" both work fine but when I try href = "/app.css" it doesn't link. I know "/" is suposed to take you to the root directory and from what I understand the directory of the html file is the root directory. So why isn't the css file linking properly?
2 Answers
No need to add the "/" or "./" because your app.css file is in your current directory.
1 Comment
Chaitanya Jain
I know, I just wanted to check whether these paths would work or not. My question is why doesn't "/' work when it should take you to the root directory and our html is already in the root directory. Shouldnt it be redundant and shouldn't the css file link properly?