Search Blog

HOW TO make a link open in a new browser window

So I started this blog and wrote my first few posts only to find out that all the links in my posts were taking readers away from my post. Did some research and turns out it is fairly simple to make a link open in a new tab or new window when a user clicks on it. Here is what you do:-

<a href ="">Daily HOWTO blog</a>
<a target="_blank" href="">Daily HOWTO blog</a>

Here are the other values available for the target attribute:-
target="_blank"      Open link in a new tab/ window.
target="_self"         Open link in the same window (default)

target="_parent"     Open link in the parent frame in a multi-frame page.
target="_top"         Open link  in top level window when used in a multi-frame page.

To make all links on your page open in a new window, just add <base target="_blank"> between the <head> and </head> tags in your html.

No comments:

Post a Comment