Search Blog

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:
Input:
<a href="https://www.akblogs.com/" target="_blank">My Blog</a>
Output:
My Blog

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

Related Posts:
Free Website hosts

I hope this article helps you, I will be writing more on these sorts of articles and don't forget to follow my blog Ali Khan Blogs on facebook at Akblogspk.

Author

Muhammad Ali Khan
Owner at AKBlogs.com

Updated: 08 March, 2018
Share:

No comments:

Post a Comment

Trending this Week