0

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?

1

2 Answers 2

1

/ means the root of the current drive

./ means the current directory

../ means the parent of the current directory

Sign up to request clarification or add additional context in comments.

Comments

0

No need to add the "/" or "./" because your app.css file is in your current directory.

1 Comment

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.