简体   繁体   English

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

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

I have a problem with the following string: 我的以下字符串有问题:

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

And it gives the following error: 并且它给出以下错误:

Bad value ../Uses In Industry/planes.html for attribute href on element a : Illegal character in path segment: not a URL code point. 元素a属性href../Uses In Industry/planes.html用于属性:路径段中的非法字符:不是URL代码点。

I have the same issue with a few more lines, and I can't see what the problem is. 我也有几行相同的问题,但我看不出问题是什么。

As @CBroe mentioned in the comments, spaces are illegal characters in a URL and must be "escaped". 正如评论中提到的@CBroe一样,空格是URL中的非法字符,必须“转义”。 The way to do this is encode them as %20 or, better yet, eliminate them all together by using hyphens or no space at all. 这样做的方法是将它们编码为%20,或者更好的是,使用连字符或完全不使用空格将它们全部消除。

More information can be found in this SO question. 可以在此SO问题中找到更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM