HTML - The link element (inter-document relationships)

> (World Wide) Web - (W3|WWW) > HyperText markup Language (HTML)

1 - About

The link element represents metadata that expresses inter-document relationships.

It's not an hyperlink


3 - Syntax

The link element can be used only within the head element.

<link rel="stylesheet" media="screen,projection" href="css/common.min.css">


You can also add a css file through the CSS Import rule

3.1 - integrity

The integrity can be calculated with the following command line. It calculate the digest with the sha384 and apply the base64 algorithm above.

openssl dgst -sha384 -binary stylesheet.css | openssl base64 -A


If the output was:


the link element would be:

<link rel="stylesheet" href="stylesheet.css "integrity="sha384-ZYfZnVukOuh/gRpU9uN+T9XwwRFJ9Y+0Ylk3zKvI184omb/HoOtQ0F8Iol7Nix7q">

4 - Type

4.1 - stylesheet

style sheet

link stylesheet

  • Sync version:
<link href="style.css" rel="stylesheet">
<!-- In the header -->
<link href="style.css" rel="preload" as="style">
<!-- Where you want to use the stylesheet (it can be at the bottom of the body) -->
<link href="style.css" rel="stylesheet" >

5 - Documentation / Reference

web/html/link.txt · Last modified: 2019/04/14 14:25 by gerardnico