Html Hyperlinks


Prev Tutorial Next Tutorial

Html Hyperlinks

Hyperlinks are used to create links that allow the users to navigate from one page to another. To create hyperlinks use <a> tag. <a> tag have following attributes;

  • href: href attribute specifies the destination address like www.tutorial4us.com/html/
  • target: target attribute specifies where to open the linked document like open in new window, open in same window.

Example

<html>
<body>
Link open in same window<a href="#" target="_top">Click Here</a>
Link open in new window<a href="#" target="_blank">Click Here</a>
</body>
</html>

Result

Link open in same window Click Here
Link open in new window Click Here

Target Attribute

Target ValueDescription
_blankOpens the linked document in new window
_topOpens the linked document in same window
_selfOpens the linked document in same frame as it was clicked (this is default)
framenameOpens the linked document in a given named frame
_parentOpens the linked document in the parent frame

Image as Link

In html you can give image as a link, when click on image linked page will be open. In below example image link is provided.

Example

<html>
<body>
<a href="/html/index" target="_top"><img src="files/sublogo.png" target="_blank"></a>
</body>
</html>

Result

Browser supported

Element
<a>YesYesYesYesYes

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements