Sal*_*lil 44
<a href="http://www.google.com" target="_blank">
<img width="220" height="250" border="0" align="center" src=""/>
</a>
Run Code Online (Sandbox Code Playgroud)
Guf*_*ffa 18
如果使用脚本导航到页面,请使用open目标方法_blank打开新窗口/选项卡:
<img src="..." alt="..." onclick="window.open('anotherpage.html', '_blank');" />
Run Code Online (Sandbox Code Playgroud)
但是,如果您希望搜索引擎找到该页面,您应该将图像包装在常规链接中.
小智 6
你可以这样做
<a href="http://www.w3c.org/" target="_blank">W3C Home Page</a>
Run Code Online (Sandbox Code Playgroud)
找到这个页面
http://www.corelangs.com/html/links/new-window.html
Run Code Online (Sandbox Code Playgroud)
goreb
<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>
Run Code Online (Sandbox Code Playgroud)
看代码
假设您想显示一个 50x50 像素的图像缩略图并链接到您可以执行的实际图像
<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>
Run Code Online (Sandbox Code Playgroud)
当然,最好给该链接一个类或 id 并将其放在您的 css 中