HTML rel="stylesheet"

A rel="stylesheet" attribute value specifies that the external link is a stylesheet that will be applied to the current page. This setting only applies to <link> tags.

Example

#

A rel="stylesheet" on a <link> element.
This stylesheet will be included into the page.

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

Using rel="stylesheet"

The rel attribute defines the relationship between the current page and the linked page or resource.

A rel="stylesheet" value specifies that the stylesheet file will be loaded into the current page.

The URL for the CSS stylesheet is specified by the href attribute.


Syntax

<link rel="stylesheet" href="url" />

Elements that accept rel="stylesheet"

Only one element accepts a stylesheet value on the rel attribute.

Elements Description
<link> Links a resource to the current page -- see example above

Browser support

Here is when rel support started for each browser:

Chrome
6.0 Sep 2010
Firefox
4.0 Mar 2011
IE/Edge
12.0 Jul 2015
Opera
11.1 Mar 2011
Safari
5.0 Jun 2010

You may also like

Guides