Monday, November 01, 2010

HTML Links with Target attribute

The target attribute specifies where to open the HTML link, i.e., either in the same page or in a new browser window or in a new tab of the same browser.

The General format/syntax to open a link in a new browser tab is:

<a href="[URL/Address]" target="_blank">[Link Text]</a>

In creating a HTML link with the target attribute the same <a> tag is used with the "href" attribute and is followed by the the URL/address of web page by replacing [URL/Address] in the syntax. The [Link Text] is replaced by the text to be shown in the link.

For Example:
<a href="" target="_blank">My Blog</a>
My Blog

This example will open the webpage in a new browser tab.
If you are new to learning about HTML, click here to learn about creating basic HTML links.

No comments:

Post a Comment

Ali Khan Blogs is a Blog about Blogging and SEO Tips and Tricks for Newbie Pakistani and Indian Bloggers