This article mainly introduces the analysis of rel attributes in HTML. Friends who need it can refer to it.
Since I found that some classmates broadcast and collect this article on Weibo, I looked back at this casually translated article. Later, I found that w3cschools.com.cn already had a comparison Chinese translation, so I will continue to improve this article here to make it appear more valuable. I initially thought of translating this document from the article http://vanessa.b3log.org/research-a-rel-value. I found that the rel attribute has many unusual semantic values. The original text focused on listing the usage scenarios of these attribute values. I felt it was very necessary to understand the rel attribute in this way.
ExampleConnection with rel attribute:
<a rel=external href=http://www.xxoo.com/>ooxx</a>
Rel attribute is supported in all mainstream browsers
注:浏览器渲染时会忽略此属性,然而搜索引擎可以从它获得更多的信息(a标签仅在href属性存在时有效)。
The rel property specifies the relationship between the current document and the connected document
grammar <a rel=value>
Deleted values: appendix, chapter, contents, copyright, glossary, index , section, start, subsection.
New values: archives, author, bookmark, external, first, index , last, license, nofollow, noreferrer, search, sidebar, tag, up.
| value | describe | Scenario | Example | HTML4.01 | HTML5 |
|---|---|---|---|---|
| appendix | Link to the appendix page of the document | |||
| alter | Link to an alternative source (such as: print pages, translations and mirrors) | Configure the atom, feed of the website in the head tag | ||
| shortcut icon | Shortcut icon | Specify title bar, address bar, favorite bar icon | ||
| archives | Link to document sets or historical data | <link rel='archives' href='http://www.ooxx.com/2012/07' /> | ||
| author | Link to the author of the document | Declare the document author in the head tag | ||
| canonical | Authoritative, exemplary | Let search engines know which page is the duplicate or similar web page in the current website that the webmaster wants it to crawl and include <link rel=canonical href=http://xxoo.com/ />
| ||
| Stylesheet | Outreach stylesheet for documents | <link rel=stylesheet href=base.css> | ||
| home | Connect to the home page of the site | <link href=http://www.ooxx.com rel=home /> | ||
| first | Link to the first document in the collection | <link rel=first href=index.html> | ||
| start | Link to the first page of the current document | <link rel=start href=about:blank> | ||
| next | Link to the next document in the collection | <link rel=next href=about:blank> | ||
| prev | Link to the previous document in the collection | <link rel=chapter href=about:blank> | ||
| Last | Link to the last document in the collection | <link rel=last href=index.html> | ||
| up | Provides a link to a document. This document provides the contextual relationship of the current document | |||
| Search | Search tools for linking to documents | |||
| sidebar | Link to a document that should appear in the browser sidebar | |||
| contents | Link to the content directory of the current document | It is usually placed in the sidebar of the main content of the document to facilitate jumping between topics on the current page | ||
| index | Link to the index of the current document | |||
| glossary | Link to the current document glossary | |||
| copyright | Link to the copyright or privacy page of the current document | Copyright at the bottom of the website | ||
| Chapter | Link to a chapter from the current document | |||
| section | Link to a section in the document list | |||
| Subsection | Link to subsections in the current document list. (One section can have multiple sub-sections.) | |||
| head | Link to top-level documents in collections | |||
| toc | Directory linked to collection | |||
| parent | Link to the document above the source | |||
| child | Link to the document below the source | |||
| help | Link to Help Documents | <link rel=help href=http://www.xxoo.net/help.html /> | ||
| bookmark | Permanent URL used as bookmark | List title | ||
| external | Link to external documents | External connections cited in the article | ||
| nofollow | Link to unauthorized documents, such as paid links Google uses nofollow to stipulate that its search spider does not track the link | Related articles on the site, random articles on the site, comments, comments, browses and author links in the list and article page, comment addresses in the sidebar, homepage links in the homepage navigation, articles with the most comments, and articles with the most accesses | ||
| noreferrer | Specifies that when the user follows the hyperlink, the browser should not send the HTTP referer header | |||
| license | Copyright information linked to the document | |||
| tag | Current document tag (keyword) | Tag cloud in the sidebar, tags in the article, tags in the list, tags for tag pages | ||
| friend | sponsor | Friendly links, themes at the bottom by |
由于本人水平有限,难免存在一些错误,看官们如果觉得有不妥或者需要补充的地方,请留言指出,谢谢!
http://www.w3schools.com/TAGS/att_a_rel.asp
http://vanessa.b3log.org/research-a-rel-value
http://www.w3school.com.cn/htmldom/prop_anchor_rel.asp
The rel-author tag that I have to mention
HTML rel canonical property value
The meaning of the link tag rel attribute
About rel=canonical(google webmaster tool)