Working with Links - What Is the Difference Between Slashes, a Single Dot, and Double Dot in Path Syntax?

Tell us what’s happening:

In the question

“Which option is an absolute path?
/public/styles.css
./script.js
../src/nav.html
https://freecodecamp.org

I chose option 4. I now learned that this is not an absolute path, because it does not point to a resource (fair enough!)

What completely confuses me though is that in just the previous lecture I was taught that absolute paths contain the protocol and start at the root directory, which the “correct” quiz option here does not do.

How does this make sense?

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36

Challenge Information:

Working with Links - What Is the Difference Between Slashes, a Single Dot, and Double Dot in Path Syntax?

/ is the root directory, so it actually starts there

1 Like