link rel Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:link

Description

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

Attribute Values

ValueDescription
alternatea link to an alternate version of the document Example: <link rel="alternate" type="application/atom+xml" title="java2s.com News" href="/blog/news/atom">
author a link to the author of the document
dns-prefetch browser should preemptively perform DNS resolution for the target resource's origin
help a link to a help document. Example: <link rel="help" href="https://www.java2s.com/style/demo/Opera.png">
icon Imports an icon to represent the document. Example: <link rel="icon" href="/favicon.ico" type="image/x-icon">
license a link to copyright information
next a link to the next document in the series
pingback the address of the pingback server
preconnect the browser should preemptively connect to the target resource's origin.
prefetch the browser should preemptively fetch and cache the target resource
preload the browser agent must preemptively fetch and cache the target resource for current navigation
prev the document is a part of a series, and that the previous document in the series is the referenced document
search Provides a link to a resource that can be used to search through the current document and its related pages.
stylesheet Imports a style sheet

An external stylesheet:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="styles.css">
</head><!--  w  w w  . ja  va  2s .  c  o  m-->
<body>

<h1>I am formatted with a linked style sheet</h1>
<p>Me too!</p>

</body>
</html>

Related Tutorials