2010-06-29 75 views

回答

0

设置它的目标=“_空白”

32
<a href="http://www.google.com" target="_blank"> 
    <img width="220" height="250" border="0" align="center" src=""/> 
</a> 
7

如果使用脚本来浏览网页,使用open方法与目标_blank打开一个新窗口/标签:

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

但是,如果您希望搜索引擎找到该页面,则应该将该图像封装在常规链接中。

+0

工作就像一个魅力 – 2018-02-26 18:38:51

5

你可以像这样

<a href="http://www.w3c.org/" target="_blank">W3C Home Page</a> 

找到这个网页

http://www.corelangs.com/html/links/new-window.html 

goreb

3
<a href="http://www.google.com" target="_blank"> //gives blank window 
<img width="220" height="250" border="0" align="center" src=""/> // show image into new window 
</a> 

看到代码

4

假设你要显示的图像缩略图其中是50x50像素和林K将实际的图像,你可以做

<a href="path/to/image.jpg" alt="Image description" target="_blank" style="display: inline-block; width: 50px; height; 50px; background-image: url('path/to/image.jpg');"></a> 

当然,最好给该链接类或ID,并把它放在你的CSS

1

要在新标签中使用开:

target = "_blank" 

要在同一选项卡内打开:

target = "_self"