English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The required rel attribute specifies the current document and the linked document/the relationship between resources.
An external stylesheet:
!DOCTYPE html <html> <head> <meta charset="utf-8"> <title>HTML <link> rel Attribute Usage-Basic Tutorial(oldtoolbag.com)</title> <link rel="stylesheet" type="text/css" href="styles.css"> </head> <body <h1>I am formatted with a linked style sheet</h1> <p>Me too!/p> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
All mainstream browsers support the rel attribute.
The rel attribute is required, specifying the relationship between the current document and the linked document/the relationship between resources.
in HTML5 Removed some HTML 4.01 The value in the syntax has added some new values.
<link rel="value">
Value | Description |
---|---|
alternate | Link to the alternative version of the document (such as a print page, translation, or mirror). |
author | Link to the author of the document. |
help | Link to the help document. |
icon | Import the icon representing the document. |
license | Link to the copyright information of the document. |
next | Indicates that the document is part of a collection, and the next document in the collection is the referenced document. |
prefetch | Specifies that the target resource should be cached. |
prev | Indicates that the document is part of a collection, and the previous document in the collection is the referenced document. |
search | Link to the search tool for the document. |
stylesheet | The URL of the style sheet to be imported. |