W3C 标记验证 - 路径段中的非法字符:不是 URL 代码点

W3C Markup Validation - Illegal character in path segment: not a URL code point

我对以下字符串有疑问:

<a href="../Uses In Industry/planes.html">

并且出现以下错误:

Bad value ../Uses In Industry/planes.html for attribute href on element a: Illegal character in path segment: not a URL code point.

同样的问题多了几行,看不出是什么问题。

正如@CBroe 在评论中提到的,space 是 URL 中的非法字符,必须是 "escaped"。这样做的方法是将它们编码为 %20,或者更好的是,通过使用连字符或根本不使用 space 来消除它们。

More information can be found in this SO question.