How to use link rel in html

下次还敢
Release: 2024-04-27 21:12:15
Original
235 people have browsed it

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

How to use link rel in html

##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:

  • stylesheet: Link to the stylesheet
  • icon: Link to favicon
  • font: Link to external font file

Syntax

The syntax of the tag is as follows:

Copy after login
Among them:

    ##rel
  • : Specifies the type of link
  • href
  • : Specify the URL of an external resource
Example

Link to a style sheet:

Copy after login

Link to favicon:

Copy after login

Link to external font:

Copy after login

Note# The

##link
    tag is usually placed in the
  • section of the HTML document. Make sure external resources are available on the server.
  • Multiple
  • link
  • tags can link to the same resource type (e.g. multiple style sheets).
  • The optional media
  • attribute can be used to specify media queries to load resources only under certain conditions.

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!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!