TGP Tutorials & Articles

Opening Links In A New Browser Window

by TGPFactory Staff, July 11 2006

The BASE TARGET tag in HTML offers a very simple solution to opening links in a new browser window. Rather than repeating TARGET="_blank" (the code that tells your web browser where to open a link) for each link on your page, you can declare a base target inbetween your HEAD/HEAD tags and forego the repetative coding - each link on your page will automatically open in a new browser window by default.

To use the BASE TARGET tag, simply place the following tag inside the <HEAD></HEAD> tags:

<BASE TARGET="_blank">
 

That's it! Every link on your page will now open in a new browser window when clicked. To set one or more links to open in the same browser window, simply add the _SELF target tag to a link:

<A HREF="" TARGET="_SELF">Link Text</A>
Copyright 2004-2008 TGP Factory. All Rights Reserved.