HTML href attribute

href attribute represents the location or URL of the linked resource.

Example

 <p>href attribute is used to make links</p>
 <a href="http://www.codingb.com" title="codingb"> Go to codingb </a>
Try </>

href attribute values

The value of href attribute is the valid URL. title attribute defines the nature of the link.

Related Tags

The tags that support this attribute are as follows.

<a> tag

a tag defines a hyperlink of the other pages.

Example

<a href="http://www.codingb.com" target="_top"> anchore text </a>

Try</>

target attribute defines the browsing mode.

<area> tag

area tag element makes a link on an area. It supports the href attribute.

Example

<area alt="triangle" title="triangle" href="files/triangle.html" shape="poly" coords="13,122,50,61,86,123" />

Try</>

It is used to specify the area on an image.

link tag imports external resources such as CSS style sheet, script file or favicon icons.

Example

<head>
<link href="files/test.css" rel="stylesheet" >
</head>
Try</>

The above example imports CSS stylesheet that design the content.

<base> tag

The base tag provides a default or alternate URL for every link in the page. base tag supports href attribute.

Example

<head>
<base href="http://www.codingb.com" target="_blank" >
</head>
Try</>


Was this article helpful?

 

Email:

Message:

Get the newsletter