How to Make a Link Appear in a New Browser Window
There will be times when you will want to make a link that appears in a completely separate window. There may be many reasons for wanting to do this. The information presented might be an amplification of the information in your current page. It might pop-up an ad, and you want to hold the reader to your website.
To get the link to pop up a new window when the reader clicks simply use a "target" attribute. Here is the salient code:
<a href="http://www.indepthinfo.com" target="_blank">InDepthInfo in a New Window</a>.
Here is the result of the code: InDepthInfo in a New Window
There are actually four different commands you can use with the target attribute:
- "_blank" will open the link in a new browser window.
- "_self" will open the link in the same window.
- "_parent" will replace the page it came from in a frameset.
- "_top" places the new page on top of the old one including any framesets.
By giving the target window an attribute you are giving it a name. You can call the target almost anything that begins with an alpha or numeric character. Then all subsequent links that have the same target will be opened in the same new window.
Return to How to Make a Link Index

