简体   繁体   English

验证:元素链接上的属性rel首先出现错误值

[英]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.

相关问题 验证错误“元素链接上属性 rel 的错误值 apple-touch-icon-precomposed:未注册关键字 apple-touch-icon-precomposed。” - Validation error “Bad value apple-touch-icon-precomposed for attribute rel on element link: Keyword apple-touch-icon-precomposed is not registered.” 相对值的验证错误 - Validation error on rel value 打印视图链接iaw HTML5的正确rel属性值 - Proper rel attribute value for print view link iaw HTML5 如何避免“元素元素属性名称的错误值语言”HTML验证错误? - How can I avoid the “Bad value language for attribute name on element meta” HTML validation error? HTML5有效的Google+按钮 - 属性rel的错误值发布商 - HTML5 valid Google+ Button - Bad value publisher for attribute rel prettyPhoto的rel属性上的验证错误 - validation error on prettyPhoto's rel attribute 元素视频的属性自动播放错误值true - Bad value true for attribute autoplay on element video 元素元属性名称的Google值错误 - Bad value google for attribute name on element meta 在XHTML5验证中摆脱“ XHTML元素元上的属性http-equiv的值X-XRDS-Location无效”。 - Get rid of “Bad value X-XRDS-Location for attribute http-equiv on XHTML element meta.” in XHTML5 validation ARIA验证错误:属性角色的错误值滑块 - ARIA validation error: Bad value slider for attribute role
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM