简体   繁体   English

我可以在“ next”和“ prev”中使用多个(超过2个)链接标签吗?

[英]Can I use multiple (more than 2) link tags with “next” and “prev”?

So, I'm adding link tags with SEO information about the previous and next page on our site, something like this: 因此,我要添加带有关于我们网站上一页和下一页的SEO信息的链接标签,如下所示:

<link rel="prev" href="/60072-page=2" />
<link rel="next" href="/60072-page=4" />

The page can contain multiple lists with paging. 该页面可以包含带有分页的多个列表。 Changing the page of a list reloads the lists content with ajax, but there is also a fallback by using normal postbacks if javascript is disabled. 更改列表的页面会用ajax重新加载列表内容,但是如果禁用了javascript,也会通过使用常规回发进行回退。 These paging links are the same that should be in the examples above. 这些分页链接应与上面的示例相同。

But since the page can have multiple lists it also means that I should have multiple link tags, like so: 但是由于页面可以有多个列表,所以这也意味着我应该有多个链接标记,如下所示:

<link rel="prev" href="/60072-page=2" />
<link rel="next" href="/60072-page=4" />
<link rel="prev" href="/15678-page=1" />
<link rel="next" href="/15678-page=3" />

Is this okay? 这个可以吗? I tried to Google it, but I can't find any information about having more links than the two default ones. 我尝试使用Google进行搜索,但是找不到有关两个默认链接以外的更多链接的任何信息。 Thank you for your help! 谢谢您的帮助!

Syntactically it's legal according to the W3C , however it appears like CSS in the case of duplicated information, the last rule wins out. 在语法上,根据W3C合法,但是在信息重复的情况下,它看起来像CSS,最后一条规则获胜。 The spec says: 规格说明:

Next - Refers to the next document in a linear sequence of documents. 下一个 -按线性文档顺序引用下一个文档。 User agents may choose to preload the "next" document, to reduce the perceived load time. 用户代理可以选择预加载“下一个”文档,以减少感知的加载时间。

Prev - Refers to the previous document in an ordered series of documents. 上一页 -在有序文档系列中参考上一个文档。 Some user agents also support the synonym "Previous". 一些用户代理还支持同义词“ Previous”。

So next/prev refer to a linear sequence of documents and not all links on a page. 因此next / prev是指线性的文档序列,而不是页面上的所有链接。 So based on your example, only 因此,根据您的示例,

<link rel="prev" href="/15678-page=1" />
<link rel="next" href="/15678-page=3" />

would be relevant. 将是相关的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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