How To Set All Links to Open in a New Window

Posted by Lasantha Bandara File Under : html

How To Set All Links to Open in a New Window

The HTML target attribute specifies where to open the linked document. If you want to open a link in a new tab or window, you can use the target="_blank" attribute like this:

<a href="https://www.facebook.com/" target="_blank">Visit Facebook</a>

But if you'd like to make all links on your Blogger site open in a new window automatically, follow the steps below:

  1. Go to your blog's "Edit HTML" page.
  2. Copy and paste the code below just after the <head> tag:
<base target="_blank" />
  1. Save your Blogger template.

Now, all links on your site such as post links, navigation links, and widget links will automatically open in a new tab or window. There is no need to add target="_blank" manually to each link.

Note: This method works not only on Blogger but also on other websites. Simply add the code shown above immediately after the <head> tag of your webpage.

7 thoughts on “How To Set All Links to Open in a New Window

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.