English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This article introduces the usage of the <a> href attribute, demonstrates how to use the <a> href attribute online, browser compatibility, syntax definition, and detailed information about its attribute values, etc.
The href attribute specifies the target address of the link:
<p>Absolute path URL: <a href="//www.oldtoolbag.com/">Basic tutorial website</a></p> <p>Relative path URL: <a href="/tags/tag-a.html">a 标签</a></p>Test and see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the href attribute.
The href attribute specifies the URL of the page to which the link goes.
If the href attribute does not exist, the <a> tag is not a hyperlink.
In HTML5 In HTML, if the <a> tag does not have an href attribute, it will be A placeholder hyperlink.
<a href="URL">
Value | Description |
---|---|
URL | The URL of a hyperlink. Possible values:
|
Using an anchor URL
How to link to an element with a specified ID in a page (HTML5The name attribute is not supported).