HTML a href Attribute | a href
❮HTMLtag[1]ExampleThehrefattributespecifiesthelinksdestination:
❮ HTML <a> tag[1]
ExampleThe href attribute specifies the links destination:
<a href="https://www.w3schools.com">Visit W3Schools</a>
Try it Yourself »[2]More "Try it Yourself" examples below.
Definition and UsageThe href attribute specifies the URL of the page the link goes to.
If the href attribute is not present, the <a> tag will not be a hyperlink.
Tip: You can use href="#top" or href="#" to link to the top of the current page!
Browser Support Attribute href Yes Yes Yes Yes Yes Syntax Attribute Values Value Description URL The URL of the link.Possible values:
An absolute URL - points to another web site (like href="http://www.example.com/default.htm") A relative URL - points to a file within a web site (like href="default.htm") Link to an element with a specified id within the page (like href="#section2...