Search the Whole World Here.,.,

HTML Links - The target Attribute

HTML Links - The target Attribute


The target attribute specifies where to open the linked document.

The target attribute can have one of the following values:
  • _blank - Opens the linked document in a new window or tab
  • _self - Opens the linked document in the same window/tab as it was clicked (this is default)
  • _parent - Opens the linked document in the parent frame
  • _top - Opens the linked document in the full body of the window
  • framename - Opens the linked document in a named frame
This example will open the linked document in a new browser window/tab:

Example

<a href="http://yaarnotech.blogspot.com/" target="_blank">Visit Yaar No Technology</a>
Try it Yourself »

Tip: If your webpage is locked in a frame, you can use target="_top" to break out of 

the frame:

Example

<a href="http://www.facebook.com/yaarnotech/" target="_top">Facebook Page</a>
Try it Yourself »
HTML Link Colors

HTML Link Colors


By default, a link will appear like this (in all browsers):
  • An unvisited link is underlined and blue
  • A visited link is underlined and purple
  • An active link is underlined and red
You can change the default colors, by using styles:

Sorry for inconvenience. You can view full code by clicking Try it Yourself Button below.

Example

Try it Yourself »
HTML Local Links

HTML Local Links


The example above used an absolute URL (A full web address).

A local link (link to the same web site) is specified with a relative URL (without http://www....).

Example

<a href="html_images.asp">HTML Images</a>
Try it Yourself »

HTML Links - Syntax

HTML Links - Syntax


In HTML, links are defined with the <a> tag:
<a href="url">link text</a>

Example

<a href="https://www.facebook.com/yaarnotech/">Visit our Facebook Page</a>
Try it Yourself »
The href attribute specifies the destination address (https://www.facebook.com/yaarnotech/) of the link.
The link text is the visible part (Visit our Facebook Page).
Clicking on the link text will send you to the specified address.
Note: Without a forward slash on subfolder addresses, you might generate two requests to the server. Many servers will automatically add a forward slash to the address, and then create a new request.
HTML Links - Hyperlinks

HTML Links - Hyperlinks

HTML links are hyperlinks.

You can click on a link and jump to another document.

When you move the mouse over a link, the mouse arrow will turn into a little hand.

Note: A link does not have to be text. It can be an image or any other HTML element.

Ads by Google