HTML - Links




HTML Links

Html link (also known as hyperlink) is a handy facility for the viewers, visitors, readers, as it helps to navigate from one page to other page of same website or from one page to other page of different website.

When you move your cursor on the hyperlinked text, image, sentence, etc. it get highlighted.

HTML links are defined as the <a> tag, known as anchor tag. for example −

Example

<a href="url">link text</a>
<a href="http://htmltpoint.com/">Visit our website</a>

The href attribute identifies the destination address i.e. given in the form of link and the link text is the visible part.

HTML Link Colors

The color of linked text, image, sentence, etc. by default appear as −

  • An active link is red or/and underlined

  • An unvisited link is blue or/and underlined

  • A visited link is purple or/and underlined

Applicable in almost all browser.

However, you can change the color as per your choice by using style sheet.

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 −

Example

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

Result

This Link open in same window Click Here


This Link open in new window Click Here