<img src="webpage photos/alcazar.jpg" alt="Alcazar Palace">
验证器显示的错误:元素 img 上属性 src 的错误值网页照片/alcazar.jpg:路径段中的非法字符:不允许空格。
一旦我删除了空格,我就尝试按照某些在线建议用连字符或 %20 替换它们,我得到更多错误,但网页正常运行。
这里似乎有什么问题?
谢谢
最佳答案
url中不允许有空格,需要替换成%20
As soon as I remove the spaces I try to replace them by hyphens or %20 as recommended by some online I get even more errors
W3C 验证服务会提示缺少doctype 声明和title 元素以及lang 属性
所以当你检查更多的代码时
<!DOCTYPE html>
<html lang="en-us">
<head>
<title>Some title</title>
</head>
<body>
<img src="webpage%20photos/alcazar.jpg" alt="Alcazar Palace">
</body>
</html>
你得到 文件检查完成。没有要显示的错误或警告。
关于html - W3C 验证失败,路径段 : space is not allowed 中的非法字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61808950/