& Lt; link & gt; Detailed description of the rel attribute of the tag, and detailed description of the linkrel attribute

Source: Internet
Author: User

<Link> detailed description of the rel attribute of a tag, and detailed description of the linkrel attribute

<Link> A tag defines the relationship between the current document and other documents in the Web set. The link element is an empty element that contains only attributes. This element can only exist in the head part, but it can appear any number of times. In HTML, the <link> tag has no ending tag. In XHTML, the <link> label must be properly disabled.

In addition to the standard and common attributes of HTML, the link element also includes many optional attributes: charset, href, hreflang, media, rel, rev, target, title, and type. In these attributes, target can only be used in the Transitional and Frameset DTD, and others can be used in the Strict, Transitional, and Frameset DTD.

Among these attributes, the rel attribute is the core and can be used by search engines to obtain more information about links.

(1)Stylesheet-- Call an external style sheet

This attribute is the most commonly used to call a style sheet, as shown below:

<link rel="stylesheet" href="http://blog.yunlives.com/style.css" type="text/css" media="screen" />
Href indicates the URL of the target document, type specifies the MIME type of the target URL, and media specifies the device on which the document will be displayed.

Media: ["screen": indicates the display device; "print": indicates the printing device;].

(2)Icon-- Define the favorites icon of a website

<link rel="shortcut icon" href="http://blog.yunlives.com/images/favicon.ico" type="images/x-icon"/><link rel="icon" href="http://blog.yunlives.com/images/favicon.png" type="images/png"/>

Icon attribute specifies the title bar, address bar, and favorite bar icons

Note: 1. IE only supports favicon in ico format; 2. the rel attribute must contain cut to be displayed under IE;

(3)Canonical-- Specify the standard version of the website

<link rel="canonical" href="http://blog.yunlives.com?page=3/" />
The canonical attribute is used to let the search engine know the duplicate or similar webpage in the current website. The website owner wants to capture and include the webpage.

(4)Author-- Declare the author of the document

(5)Home-- Connect to the home page of the site

(6)Search-- Search tools linked to documents

(7)Sidebar-- Link to the document that should be displayed in the browser sidebar

(8)Friend-- Links

Reference link:




The rel attribute of the link label in CSS. What is the full spelling of this "rel?

<A> the rel attribute of a tag is used to specify the relationship between the current document and the linked document.
The optional properties rel and rev of the <a> label indicate the formal relationship and direction between the source document and the target document, respectively. The rel attribute specifies the relationship between the source document and the target document, while the rev attribute specifies the relationship from the target document to the source document. These two attributes can be used in the <a> label at the same time.
The values of the rel or rev attribute are separated by spaces. The actual relationship names and their meanings depend on you: the HTML or XHTML standards have not formally proposed these two attributes. For example, a document in a series of documents may include its relationship in the link:

The reference material is the basic language for learning html. You can click here to see if this is common.
Reference: www.w3school.com.cn/tags/att_a_rel.asp

Q: What is the use of the attribute rel in the <link> label?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.