/    Sign up×
Reference /Pin to ProfileBookmark

The link tag, or External Resource Link element, provides the relationship between the current document and an external resource, such as CSS style sheets, favicon, JavaScript file, etc.

Syntax

The <link> tag only contains attributes and does not wrap around anything.

<head>
  <link rel="stylesheet" href="/assets/css/style.css">
</head>

Attributes

crossorigin
Determines how the <link> tag handles cross-origin requests. Possible values: anonymous or use-credentials.

href
Provides the URL from where the external resource is fetched.

hreflang
Identifies the language that the linked resource is in.

media
Identifies the media or device on which the linked resource will be displayed.

referrerpolicy
Determines which referrer information is sent when fetching the external resource. Possible values: no-referrer, no-referrer-when-downgrade, origin, origin-when-cross-origin, and unsafe-url.

rel
Depending on the specified value, specifies the relationship between the linked resource and the current URL. This attribute is required. Possible values: alternate, author, dns-prefetch, help, icon, license, next, pingback, preconnect, prefetch, preload, prerender, prev, search, and stylesheet.

sizes
When using rel="icon", this attribute provides the size of the external resource, in heightxwidth format.

title
Designates an alternate or preferred stylesheet.

type
Identifies the media type of the external resource.

Browser Compatibilty

Demos

Have a code example of <link>? Submit a codepen.io demo and we'll showcase it here

to submit a demo.
HTML
×

Success!

Help @reference spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...