Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make HTML open a hyperlink in another window or tab?

This is a line for a hyperlink in HTML:

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

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?

like image 374
brilliant Avatar asked Feb 26 '10 18:02

brilliant


People also ask

How can you force the browser to open a link in a new window or tab?

You can open a new window (HTML4) or a new browsing context (HTML5). Browsing context in modern browsers is mostly "new tab" instead of "new window". You have no influence on that, and you can't "force" modern browsers to open a new window. In order to do this, use the anchor element's attribute target.

Can you force a link to open in a new tab?

Creating links to open in a separate tab is accomplished by adding additional text to the end of your page URL. This instructs the web browser to open the link as a new tab.

How do you get a link to open in a new window or tab use the value for the target attribute?

A target attribute with the value of “_blank” opens the linked document in a new window or tab. A target attribute with the value of “_self” opens the linked document in the same frame as it was clicked (this is the default and usually does not need to be specified).

How do you click on a link and have it open in a new window?

You can hold the Shift key and left-click a link to force opening in a new window.


1 Answers

<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.

like image 120
Frank Avatar answered Oct 10 '22 15:10

Frank