info@tutsfinder.in



HTML Links



Links are the content which are found on all web pages, and is used to click from one page to another page.

HTML links are also called as hyperlinks, when a user clicks on a hyperlink It redirects to another document.

Identification for a hyperlink is when a user moves a mouse on hyperlink the arrow will turn into a little hand.


Syntax:

Hyperlinks are defined with the HTML <a> tag.

<a href = “url”> link text </a>

Example
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<p> Click on <a href= http://www.tutsfinder.in/ target=”_blank”> this-
Link</a> to go to home page of tutfinder. </p>
</body>
</html>


Target Attribute of HTML Link

It specifies where to open the linked document.

Values of target attribute:

• _blank- open the linked document in a new window or tab.

• _self- opens the linked document in the same window or tab.

• _parent- opens the linked document in the parent frame.

• _top- opens the linked document in the full body of the window.


HTML links can have the following:

Button as a Link

To use an HTML button as a link, you have to add some JavaScript code.JavaScript allows you to specify what happens at certain events, such as a click of a button.

Example:

<button onclick = “document.location = ‘default.asp’ “> HTML tutorial </button>

Image as a Link

Links can be commonly used as images.

Example:

<a href = “default.asp”> <img src = “smiley.gif” alt= “HTML tutorial” style = “width: 40px; height : 40px;border:0;”> </a>

Link Titles

The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves over the element.

Example:

< a href = “http://www.tutsfinder.in/” title=”Go to Tutsfinder HTML tutorial”> Visit our HTML Tutorial </a>