The
link tag allows HTML documents to link to external resources such as style sheets, icons, and fonts. The rel attribute specifies the link type. The most common values are: stylesheet: link to the style sheet icon: link to the website icon font: link to the external font file
##Usage of link rel in HTML
Introduction to link tag
In HTML documents, the tag is used Link documents with external resources such as style sheets, icons, and fonts.
Usage of the rel attribute
#rel The attribute is used to specify the type of link or the resource associated with it. There are several different
rel attribute values, the most common of which are:
: Link to the stylesheet
: Link to favicon
: Link to external font file
Syntax
The syntax of the tag is as follows:
<code class="html"><link rel="resource-type" href="resource-url" /></code>
Link to a style sheet:
<code class="html"><link rel="stylesheet" href="styles.css" /></code>
<code class="html"><link rel="icon" href="favicon.ico" /></code>
<code class="html"><link rel="font" href="fonts/font.ttf" /></code>
##link
section of the HTML document.
Make sure external resources are available on the server.
The optional
media
The above is the detailed content of How to use link rel in html. For more information, please follow other related articles on the PHP Chinese website!