views:

221

answers:

4

This is a line for a hyperlink in HTML:

<a href="http://www.starfall.com/"&gt;Starfall&lt;/a&gt;

Thus, if I click on "Starfall" my browser - I am using FireFox - will take me to that new page and the contents of my window will change. I wonder, how can I do this in HTML so that the new page is opened in a new window instead of changing the previous one? Is there such a way in HTML?

And if yes, is there a way to open the requested page in another tab (not another window) of my browser?

A: 

use target="_blank"

<a target='_blank' href="http://www.starfall.com/"&gt;Starfall&lt;/a&gt;

jldupont
+2  A: 
<a href="http://www.starfall.com/" target="_blank">Starfall</a>

Whether it opens in a tab or another window though is up to how a user has configured her browser.

Frank
Not all browsers support tabs and in those that do, pages opening in a new tab vs. a new window is a user-configurable setting. There is no current way to specify a link needs to open in a tab vs. a window.
bta
Thanks a lot!!!
brilliant
+1  A: 

You should be able to add

target="_blank"

like

<a href="http://www.starfall.com/" target="_blank">Starfall</a>
Jason
+1  A: 

Simplest way is to add a target tag.

<a href="http://www.starfall.com/" target="Starfall">Starfall</a>

Use a different name for each link if you want them to open in different tabs, the same name if you want them to replace the other ones.

Turnkey
+1 for pointing out that the target doesn't have to be '_blank'.
GSto
WOW!!! Thank you!
brilliant
You're welcome!
Turnkey