html tutorial - href Attribute in HTML - html5 - html code - html form




Href attribute in html

Learn html - html tutorial - Href attribute in html - html examples - html programs

  • The href is stands for Hypertext REFerence. The href attribute is used to specify the URL of the linked resource.
  • To highlight the specific word for the reference we use href and it will be highlighted as a hyperlink.

Syntax for href attribute in HTML:

<a href="URL">

Applies To:

Elements Attribute Definition
<a> href To specify internal or external link.
<area> href To specify internal or external link.
<base> href To specify all relative URLs on a page will be referred.
<link> href To specify external resource link.

href Attribute Value:

Value Description
URL URL is used to specify the location of the link.

Sample Coding for href Attribute in HTML:

Tryit<!DOCTYPE html>
<html>
    <head>
        <title>Wikitechy href attribute</title>
    </head>
    <body>
        <a href="http://www.wikitechy.com">Click here</a>
    </body>
</html>

Code Explanation for href Attribute in HTML:

href Attribute Code Explanation

  1. <a> anchor tag is used to define a hyperlink.
  2. href attribute is used to specify the URL of target location.
  3. “http://www.wikitechy.com” is the URL of target location.
  4. “Click here” text will be visible to the user.

Output for href Attribute in HTML:

href Attribute Output

  1. If user click on the “Click here” text it will navigate to wikitechy.com website.
  2. href Attribute Output
  3. The output shows the www.wikitechy.com web page

Browser Support for href Attribute in HTML:

Yes Yes Yes Yes Yes

Related Searches to href Attribute in html

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.

×