This article provides the usage of link tags in HTML, including: self-closing tags used to declare external resources or specify document relationships. The format is: . The rel attribute specifies the resource relationship, which can be stylesheet, icon, alternate, next/prev. The type attribute specifies the resource media type, such as text, style sheet, etc. The href attribute specifies the resource URL. Can contain other attributes such as media (media type), sizes (size), charset (character set).
Usage of link tag in HTML
The link tag is used to declare external resources or specify documents in HTML documents The relationship between. It is a self-closing tag with no closing tag.
Usage format:
<code class="html"><link rel="type" href="URL" /></code>
Where:
Type attribute:
The rel attribute of the link tag can specify the following types of relationships:Other attributes:
The link tag can also contain the following attributes:Example:
The following example links an external style sheet into an HTML document:<code class="html"><link rel="stylesheet" type="text/css" href="style.css" /></code>
Note:
The above is the detailed content of How to use link tag in html. For more information, please follow other related articles on the PHP Chinese website!