Home>Article>Web Front-end> Detailed explanation of the rel attribute of thetag

Detailed explanation of the rel attribute of thetag

巴扎黑
巴扎黑 Original
2017-06-27 13:27:30 2439browse

The

2cdf5bf648cf2f33323966d7f58a7f3f tag defines the relationship between the current document and other documents in the Web collection. The link element is an empty element that contains onlyattributes. This element can only exist in theheadsection, but it can appear any number of times. In HTML, the 2cdf5bf648cf2f33323966d7f58a7f3f tag does not have a closing tag. In XHTML, the 2cdf5bf648cf2f33323966d7f58a7f3f tag must be closed properly.

In addition to the standard general attributes of HTML, the link element also includes many optional attributes: charset, href, hreflang, media, rel, rev, target, title and type. Among these attributes, target is only allowed to be used in two DTDs: Transitional and Frameset.Otherscan be used in three DTDs: Strict, Transitional and Frameset.

Among these attributes, the rel attribute is the core. Search engines can use this attribute to obtain more information about the link.(1)

stylesheet

-- Calling an external style sheetThis attribute is the most commonly used and is used to call a style sheet, as shown below:

Where href is 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 website favorite icon

 
icon attribute specifies the title bar, address bar, and collection bar small icons


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


##(3)

canonical

-- Specifies the canonical version of the URL

The canonical attribute is used to let the

search

engine know which of the duplicate or similar web pages in the current website is the page that the webmaster wants it to be. Captured and included.


##(4)
author

-- Declaration of document author


(5)
home

-- Connect to the home page of the site

(6)search-- Search tool that links to the document

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

(8 )friend-- Friendly link


##Reference link:

http: //www.cnblogs.com/aNd1coder/archive/2012/05/30/2526359.html

http://www.dreamdu.com/xhtml/attribute_rel/

http://www.w3school.com.cn/jsref/prop_anchor_rel.asp

The above is the detailed content of Detailed explanation of the rel attribute of thetag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn