What should we use forward slash / or backslash \ in absolute path of links?

Viewed 862

All of these absolute path of links are working perfectly.

<img src="\Users\dell\Desktop\brackets html files\Images\animal640.png" alt="">
<img src="/Users/dell/Desktop/brackets html files/Images/animal640.png" alt="">
<img src="\Users/dell\Desktop/brackets html files\Images\animal640.png" alt="">

But which one am I supposed to use? Which one is the recommended one? What is the difference between them?

1 Answers

URLs use forward slashes (/) (on all platforms).

Backslashes (\) are used for local file paths on Windows. URLs are not local file paths. Not even file: scheme URLs are local file paths — they are URLs.

Related