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 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>
<!-->
<!DOCTYPE>
<a>
<abbr>
<address>
<area>
<article>
<aside>
<audio>
<b>
<base>
<bdi>
<bdo>
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<cite>
<code>
<col>
<colgroup>
<data>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<footer>
<form>
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<meta>
<meter>
<nav>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<picture>
<pre>
<progress>
<q>
<rp>
<rt>
<rtc>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<template>
<textarea>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<u>
<ul>
<var>
<video>
<wbr>
accept
accept-charset
action
allowfullscreen
alt
as
async
autocomplete
autofocus
autoplay
buffered
capture
charset
checked
cite (attr)
cols
colspan
content
controls
coords
crossorigin
data (object)
datetime
decoding
default
defer
dir
disabled
download
enctype
for
form (attr)
formaction
formenctype
formmethod
formnovalidate
formtarget
headers
height
high
href
hreflang
http-equiv
integrity
ismap
kind
label (attr)
label (track)
list
longdesc
loop
low
max
maxlength
media
method
min
minlength
multiple
muted
name
name (meta)
nonce
novalidate
open
optimum
pattern
ping
placeholder
played
playsinline
poster
preload
readonly
rel
required
reversed
rows
rowspan
sandbox
scope
selected
selectionDirection
selectionEnd
selectionStart
shape
size
sizes
span (col)
src
srcdoc
srclang
srcset
start
step
target
text
type
type (button)
type (input)
type (list)
type (object)
typemustmatch
usemap
value
volume
width
wrap
xmlns
onabort
onafterprint
onanimationcancel
onanimationend
onanimationiteration
onbeforeprint
onbeforeunload
onblur
oncanplay
oncanplaythrough
onchange
onclick
oncontextmenu
oncopy
oncuechange
oncut
ondblclick
ondrag
ondragend
ondragenter
ondragleave
ondragover
ondragstart
ondrop
ondurationchange
onemptied
onended
onerror
onfocus
onhashchange
oninput
oninvalid
onkeydown
onkeypress
onkeyup
onload
onloadeddata
onloadedmetadata
onloadstart
onmessage
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup
onoffline
ononline
onpagehide
onpageshow
onpaste
onpause
onplay
onplaying
onpopstate
onprogress
onratechange
onredo
onreset
onresize
onscroll
onsearch
onseeked
onseeking
onselect
onstalled
onstorage
onsubmit
onsuspend
ontimeupdate
ontoggle
ontouchcancel
ontouchmove
ontouchstart
ontransitioncancel
ontransitionend
onundo
onunload
onvolumechange
onwaiting
onwheel