HTML <link> href attribute

Definition and usage

href Attribute specifies the location of an external resource (usually a stylesheet file) (URL).

Example

Link to an external stylesheet:

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

Try it yourself

Syntax

<link href="URL">

Attribute value

Value Description
URL

The URL of the linked resource/document.

Possible values:

  • Absolute URL - points to another website (e.g., href="http://www.example.com/theme.css"}
  • Relative URL - points to a file within the website (e.g., href="/themes/theme.css"}

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support