How To Open Links in New Window or New Tab

Posted by Lasantha Bandara File Under : html 9 Comments

As a webmaster, you likely prefer to keep visitors on your site as long as possible. One effective way to achieve this is by making external links open in a new window or tab. This ensures that your site remains open while visitors explore the linked content.

Using target="_blank" or target="new"

The most common way to open links in a new window or tab is by using the target="_blank" attribute. You can also use target="new", which functions the same way.

For Text Links

To open a text link in a new window or tab, use the following format:

<a href="website URL" target="_blank">Website Name</a>

Example:

<a href="https://www.premiumbloggertemplates.com/" target="_blank">Blogger Templates</a>

This will appear as:

Blogger Templates

For Image Links

To open an image link in a new window or tab, use this format:

<a href="website URL" target="_blank">
  <img src="Image URL" alt="Description">
</a>

Example:

<a href="https://www.premiumbloggertemplates.com/" target="_blank">
  <img src="https://www.bloggertipandtrick.net/wp-content/uploads/2009/04/premiumbloggertemplates.jpg" alt="Premium Blogger Templates">
</a>

By using these methods, you can ensure that your visitors stay engaged on your site while they explore external content, enhancing their overall browsing experience.

9 thoughts on “How To Open Links in New Window or New Tab

  1. In Blogger, how do you make this the default, rather than having to edit the html every time you insert an image?

  2. Hey Man,
    Thanks for the hack, but my blog template has a (Full Story) but i want it to open in a new tab and not in same page.
    So what should i do?
    Your reply will be highly appreciated.

  3. Many Many thanks.I want to open only few links in new tab and there was no option to implement this in text gadget.But your post solved my problem.keep it up your good work.I am fan of your blog.Thanks.my blog is related to how to earn money online in india. Thank you dude !!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.