HTML A Href Attribute: A Quick And Simple Guide
Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
- Attribute of
- How To Use a (For Creating Hyperlinks) In HTML
- What does
HTML A Href Attribute: A Quick And Simple Guide
do? - Specifies the linked document, resource, or location.
Contents
Code Example
<a href="https://html.com/attributes/a-href/">Learn about the a href attribute</a>
Different URL Forms
The URL may be:
- Fully Qualified (include a protocol)
https://html.com
https://html.com
- URL with a relative (unspecified) protocol
//html.com
- Browser-specific protocol
chrome://settings/
- Relative to the current page
next
- Relative to the current domain
/
/wp-content/uploads/flamingo.jpg
Values of the href Attribute
Value Name | Notes |
---|---|
url | The URL (URI) of the linked resource. |
All Attributes of the anchor
Element
Attribute name | Values | Notes |
---|---|---|
hreflang | Specifies the language of the linked resource. | |
download | Directs the browser to download the linked resource rather than opening it. | |
target | _blank _parent _self _top frame name | Specifies the context in which the linked resource will open. |
title | text | Defines the title of a link, which appears to the user as a tooltip. |
href | url | Specifies the linked document, resource, or location. |
name |
Browser Support for href
All | All | All | All | All | All |