HTML Links



Links are found on every webpage.Either a text could be used as a link or an image.

HTML Hyperlink

Hyperlink or simply a link is is used to take the visitor to the page of our choice.When mouse pointer is moved over a link it changes to a hand.
Links can be used on other sites to direct the user to our webpage or can be used on our site to take the user to different pages.
When you move the cursor over it,then cursor changes to a hand.
Here is an example of a link:HTML Tutorial
Click the link and see the result.It will take you to the first page of HTML tutorial.

Syntax of link

Let us now move on how to create a link.It can be created by the
< a> with 'href' attribute.
syntax:

<a href="url">link</a>
This will take you to another page on the site-Link Attributes

HTML Target Attribute

<a href="http://programmingbulls.com" target="">
</a>

The target attribute specified above decides where to open the linked document.
The link can open in one of the following:

  • New tab/window
  • Same Window

HTML Open Link In New Tab

Changing the value of the target attribute we can open the link in new tab/window.

<a href="http://programmingbulls.com" 
target="_blank">
Open link in new tab
</a>

Example-Open link in new tab
Note:Click on the link above to see the result.

HTML Open Link In Same Window

Changing the target value we can open the link in the same window.

<a href="http://programmingbulls.com" target="_self">
Open link in same window</a>

Example-Open link in same window
Note:Cick on the above link to see the result

Using Image As Link

We can use an image as a link on a page to direct a visitor to our
webpage.Here is an example:

<html>
<a href="http://programmingbulls.com">
<img src="http://programmingbulls.com/images/logo.jpg"
height="30" width="50"/>
</html>

Learn more about HTML Images
To find how to use email-links click on the following-Email links

HTML Meta Tags                        HTML Link Attributes