<link> tag details

<link>                               defines the relationship between two linked documents and is defined in the head section of an HTML document.

Commonly used to link external css files, link favicons (favicon.ico)

(1) Linking external style sheets

Html code 
  1. <link href="img/divcss5.css" rel="stylesheet" type="text/css" />   

 ① href value is the external resource address, here is the address of css

 ②rel defines the relationship between the current document and the linked document, here is the external css style sheet or stylesheet

 ③type specifies the MIME class of the linked document, where the value is text/css

 

(2) Use link to refer to the web page favicon

Html code 
  1. <link rel="icon" href="favicon.ico" type="image/x-icon" />   

 ①href value is the external resource address here is the address of the favorite icon

 ②rel defines the relationship between the current document and the linked document, here is the external icon icon attribute

 ③type specifies the MIME class of the linked document, where the value is image/x-icon

[Special Instructions]: The <link> tag does not necessarily have to be placed in the <head></head> tag, it can be appropriately placed in the part above <body> and </body>, the effect is the same, but it is recommended to place it in the head tag. Inside.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326217034&siteId=291194637