当我尝试使用W3C 验证服务验证我的页面时,我收到此错误:
Error Line 13, Column 11: there is no attribute "REL"
<LINK REL="SHORTCUT ICON" HREF="favicon.ico" />
为什么会这样?
当我尝试使用W3C 验证服务验证我的页面时,我收到此错误:
Error Line 13, Column 11: there is no attribute "REL"
<LINK REL="SHORTCUT ICON" HREF="favicon.ico" />
为什么会这样?
这是我在我的网站上使用的代码:
<link href="http://www.mysite.com/favicon.ico" rel="shortcut icon" />
它根据http://validator.w3.org/有效且有效。
我认为您的代码的主要问题是您使用的是大写字母。请改用小写字母。
由于您的 favicon 可能在许多页面上使用,我还建议您使用完整地址,如上面的代码中所示,这样您网站上的所有文件都可以找到 favicon,无论它们位于哪个文件夹中。
问题已解决
<link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" />