"."/> ".">

Home  >  Article  >  Web Front-end  >  What do link and rel mean when introducing CSS styles?

What do link and rel mean when introducing CSS styles?

WBOY
WBOYOriginal
2022-06-30 11:47:247687browse

Introduce link and rel in CSS style: 1. Link is a tag in HTML used to define the relationship between a document and external resources. The most common use is to connect a CSS style sheet; 2. rel is a tag that stipulates the relationship between the current document and external resources. For the attributes of the relationship between linked documents or resources, the style syntax to introduce is "".

What do link and rel mean when introducing CSS styles?

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

Introducing the meaning of link and rel in Css style

link

## tag defines the relationship between the document and external resources. The most common use of the

tag is to link style sheets.

Note: The link element is an empty element, it only contains attributes.

Note: This element can only exist in the head section, but it can appear any number of times.

rel attribute

The rel attribute is required and specifies the relationship between the current document and the linked document/resource.

The syntax is:


<link rel="value">

The attribute value of this attribute is as follows:

  • alternate Link to an alternative version of the document (such as a printed page , translation or mirroring).

  • author Link to the author of this document.

  • help Link to help documentation.

  • icon Imports the icon representing the document.

  • license Link to the copyright information for this document.

  • next means that the document is part of the collection and the next document in the collection is the referenced document.

  • prefetch specifies that the target resource should be cached.

  • prev means that the document is part of the collection and the previous document in the collection is the referenced document.

  • search Links to search tools for documents.

  • stylesheet The URL of the stylesheet to import.

The example is as follows:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>123</title>
<link rel="stylesheet" type="text/css" href="styles.css"> 
</head>
<body>
<h1>我是通过样式文件 styles.css 渲染后显示的。</h1>
<p>我也是。</p>
</body>
</html>

Output result:

What do link and rel mean when introducing CSS styles?

(Learning video sharing:

css video Tutorial,html video tutorial)

The above is the detailed content of What do link and rel mean when introducing CSS styles?. 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