VOOZH about

URL: https://www.geeksforgeeks.org/html/html-href-attribute/

⇱ HTML href Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML href Attribute

Last Updated : 20 May, 2026

The HTML href attribute specifies the URL of a document, allowing one page to link and navigate to another.

  • Defines the destination address of a hyperlink.
  • Commonly used with the <a> (anchor) tag.
  • Can link to web pages, files, email addresses, or sections within a page.
  • Enables navigation between different documents.

HTML <a> href Attribute

It is used to specify the URL of the page that the link goes to. When the href attribute is not present in the <a>, then the element will not be a hyperlink.

Syntax

<a href="URL">

HTML <base> href Attribute

The HTML <base> href attribute is used to specify the base URL for all the relative URL of a page.

Syntax

<base href="URL">

HTML <area> href Attribute

The <area> href attribute is used to specify the URL of the target page. When the href attribute is not present in the <area>, an element that it will not be a hyperlink.

Syntax

<area href="URL">

HTML <link> href Attribute

The HTML <link> href attribute is used to specify the URL of the linked document. It mostly contains the URL of the stylesheet file. 

Syntax

<link href = "url">
Comment