我们应该在链接的绝对路径中使用正斜杠 / 或反斜杠 \ 什么?
What should we use forward slash / or backslash \ in absolute path of links?
所有这些链接的绝对路径都运行良好。
<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="">
但是我应该使用哪一个呢?推荐哪一款?它们有什么区别?
URL 使用正斜杠 (/
)(在所有平台上)。
反斜杠 (\
) 用于 Windows 上的本地文件路径。 URL 不是本地文件路径。甚至 file:
方案 URL 都不是本地文件路径——它们是 URL。
所有这些链接的绝对路径都运行良好。
<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="">
但是我应该使用哪一个呢?推荐哪一款?它们有什么区别?
URL 使用正斜杠 (/
)(在所有平台上)。
反斜杠 (\
) 用于 Windows 上的本地文件路径。 URL 不是本地文件路径。甚至 file:
方案 URL 都不是本地文件路径——它们是 URL。