References

Collection of references for web development.

HTML link tag

Description

The HTML <link> element represents a link to an external resource, commonly used to link to cascading style sheets (CSS).

Attributes

Attribute Value Description
as audio
document
embed
fetch font
image
object
script
style
track
worker
video
Specifies the type of content for the link, can only be used if the content is being preloaded.
crossorigin anonymous
use-credentials
Allow data from third-party websites that allow cross-origin access so you can reuse it.
href URL Determines the URL to where the link will point to or the name of the anchor.
hreflang language_code The language code for the destination URL.
media Operators: and|not|,
Devices: all, print, screen, speech
Values: aspect-ratio, color, color-index, grid, height, monochrome, orientation, resolution, scan, width
Specifies the media type for which the element or the document is designed for.
rel alternate
author
bookmark
canonical
external
help
icon
license
manifest
next
nofollow
noopener
noreferrer
pingback
prefetch
preload
prev
search
shortlink
stylesheet
tag
Specifies the relationship between the current and target documents.
sizes list Specifies image sizes for different document sizes.
title string Specifies a title for the element.
type MIME type Specifies the media type for the URL.

Example

<link href="style.css" rel="stylesheet">

Example #2

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Document with CSS</title>
		<link href="style.css" rel="stylesheet">
	</head>
	<body>
		<p>Page content...</p>
	</body>
</html>