HTML <link> hrefAttributes

HTML link 标签参考手册HTML <link> Tag

Example

Link to an external stylesheet:

<link rel="stylesheet" type="text/css" href="theme.css.html">

Try it yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the href attribute.


Definition and Usage

The href attribute specifies the location (URL) of the external resource (usually a stylesheet file).


Differences between HTML 4.01 and HTML5

None.


Syntax

<link href="URL.html">

Attribute Values

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.html")


HTML link 标签参考手册HTML <link> Tag Other Extensions