简体   繁体   中英

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:

<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. 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:

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 .

使用临时模板w3c并在图库页面上找到rel =“ title”,这导致val失败从脚本中删除了它,但我不知道它做了什么。在所有平台上测试网站后,属性值仍然不知道它在做什么相对=“标题”

Faced same problem with validator (when used fancybox plugin). 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')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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