ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

09-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>
Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!