HTML <link> href Attribute

Definition and Usage

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

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