HTML Attributes
HTML href attribute
Specifies a link destination, resource URL or document base URL depending on the element. An anchor without href is not a normal navigable hyperlink. Relative URLs resolve against the document base URL. Applicable elements include: <a>, <area>, <base>, <link>. Check each element’s value rules.
Formal Syntax & Structure
html syntaxhtml
href="#details"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| href | URL | Specifies a link destination, resource URL or document base URL depending on the element. An anchor without href is not a normal navigable hyperlink. Relative URLs resolve against the document base URL. |
Working Example
Example Snippethtml
<a href="#details">Read details</a><h2 id="details">Details</h2>Browser Compatibility
Minimum supported versions across modern rendering engines
Blink (modern)
Chrome
1
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
1
Yes
WebKit
Safari
1
Yes
Basic href on anchor; link, base, area and URL schemes have separate behavior.
HTML Living Standard