09-Text Links

0
268

This tutorial is all about Text Links.
Links can be found in all web pages that allow users to freely click from page to page. The HTML links are called the hyperlinks.  It is a text or an image that you can click on, and redirect to another document.

 

This the syntax of an HTML links:

<a href="url">text link</a>

Example:

<a href="http://itsourcecode.com/category/html/">You can visit our HTML tutorial</a>

 

The href attribute is used to specify the destination of the address (http://itsourcecode.com/)

The link text serves as the visible part (You can visit our HTML tutorial).

When you click the link text, it will redirect to the specified address.

 

The target attribute is used to specify where to open the linked document.

Here’s an example if you want to open the linked document to a new browser or new tab page:

<a href="http://itsourcecode.com/" target="_blank">Visit ItSourcecode!</a>

 

Target Value Description
_blank Opens the linked document in a new tab or  window
_self Opens the linked document in the same window
_parent Opens the linked document in the parent window
_top Opens the linked document in the full body of the window
framename Opens the linked document in a named window

You can use target=”_top” to break out of the window just in case your web page is locked in a window:

<a href="http://itsourcecode.com/" target="_top">Visit ItSourcecode!</a>

 

 

Readers might read also:

Facebook Comments
(Visited 11 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here