[英]Validation: Bad value first for attribute rel on element link
I'm using Piwigo photo gallery software and it dynamically generates some code in the head of the page, which displays like this: 我正在使用Piwigo照片画廊软件,它会在页面顶部动态生成一些代码,如下所示:
<link rel="first" title="First" href="picture.php?/2601/category/37">
<link rel="prev" title="Previous" href="picture.php?/2619/category/37">
<link rel="next" title="Next" href="picture.php?/2621/category/37">
<link rel="last" title="Last" href="picture.php?/2760/category/37">
<link rel="up" title="Thumbnails" href="index.php?/category/37">
When I run it through the validator, I get errors as follows: 通过验证器运行它时,出现以下错误:
Line 21, Column 71: Bad value first for attribute rel on element link: The string first is not a registered keyword or absolute URL.
…" href="picture.php?/2601/category/37"> <link rel="prev" title="Previous" hre…
Line 21, Column 282: Bad value last for attribute rel on element link: The string last is not a registered keyword or absolute URL.
…" href="picture.php?/2760/category/37"> <link rel="up" title="Thumbnails" hre…
Line 21, Column 348: Bad value up for attribute rel on element link: The string up is not a registered keyword or absolute URL.
…category/37"> <link rel="up" title="Thumbnails" href="index.php?/category/37">
After some reading, I have come to understand that HTML5 has removed rel up, first and last, though it has kept prev and next. 经过一番阅读后,我了解到HTML5保留了上一个和下一个,尽管它删除了rel和up。 What I don't understand though is what to replace up, first and next with?
我不明白的是,首先要替换的是什么? If I remove them completely, the validator isn't happy with that either.
如果我将其完全删除,验证器对此也不满意。
Does anyone know? 有人知道吗? Thanks.
谢谢。 :)
:)
In HTML5 you are only allowed to use the following values for the rel
attribute: 在HTML5中,只允许将以下值用于
rel
属性:
If you need another link type, you would have to register it . 如果您需要其他链接类型,则必须进行注册 。
About the removal of first
/ index
: Semantics of rel=first and rel=index breaks specs and implementations . 关于
first
/ index
的删除: rel = first和rel = index的语义违反了规范和实现 。
使用临时模板w3c并在图库页面上找到rel =“ title”,这导致val失败从脚本中删除了它,但我不知道它做了什么。在所有平台上测试网站后,属性值仍然不知道它在做什么相对=“标题”
Faced same problem with validator (when used fancybox plugin). 验证器面临相同的问题(使用fancybox插件时)。 You can replace
rel
to something like data-rel
and make appropriate changes in your scripts (ie for fancybox we need to replace all attr('rel')
with attr('data-rel')
您可以将
rel
替换为data-rel
并在脚本中进行适当的更改(即对于fancybox,我们需要将所有attr('rel')
替换为attr('data-rel')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.