Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link an image and target a new window

Tags:

html

I have a picture, if I click onto that picture, how can I build an image reference so another page opens in a new tab or a new window of my browser displaying the picture?

like image 978
Abid Ali Avatar asked Jun 29 '10 10:06

Abid Ali


People also ask

How do you target a link to open a new window?

How to Open Hyperlinks in a New Browser Tab or Window. The short answer is: just add a target="_blank" attribute to your links (anchor tags). Now when your visitors click that link, it will open in a new window or tab (depending on which web browser they are using and how they configured that browser).

How do I make an image a link open in a new tab?

Sometimes we may want the linked page to open in a new browser tab or window. To do this we add target="_blank" in the first section before > . We can do this for both an image or text link. That's it – how to add a text link, image and an image link in HTML.

How do you link a new window in HTML?

You can make a HTML link open in a new tab by adding the target=”_blank” attribute. You should insert this after the link address.

How do I associate an image with a link?

Adding Hyperlinks to Images in Word Insert the image into the document. Right-click the image and select "Link" from the drop-down menu. Type or paste the hyperlink address into the "Address" field.


2 Answers

<a href="http://www.google.com" target="_blank">   <img width="220" height="250" border="0" align="center"  src=""/> </a> 
like image 66
Salil Avatar answered Oct 07 '22 17:10

Salil


If you use script to navigate to the page, use the open method with the target _blank to open a new window / tab:

<img src="..." alt="..." onclick="window.open('anotherpage.html', '_blank');" /> 

However, if you want search engines to find the page, you should just wrap the image in a regular link instead.

like image 43
Guffa Avatar answered Oct 07 '22 17:10

Guffa