如何使图片可点击? [英] How do I make an image clickable?

查看:60
本文介绍了如何使图片可点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是html:

<div id="panelpic1">
    <a href="https://www.google.com/"style="display:block"target="_blank">
    </a>
</div>

CSS:

  #panelpic1{
            content: url(file:///D:/MOHIT/HTML/images.jpg);
            float: left;
            width: 250px;
            height: 150px;
            vertical-align: middle;               
           }

这是我的操作方式,但是没有用.图片不可点击.该怎么办?

This is the way I did it, but it is not working. The image is not clickable. What to do?

推荐答案

<!DOCTYPE html>
<html>
<body>

<span>Open image link in a new tab: 
 <a href="http://www.google.com" target="_blank">
  <img src="D:/MOHIT/HTML/images.jpg" />
 </a>
</span>

</body>
</html>

这不是最佳方法.这是使图像可点击的标准方法之一.

This is not the best approach. Here is one of the standard approaches to make image clickable.

<a href="your landing page url">
 <img src="your image url" />
</a>

现在,该图像将在点击时通过指定的URL重定向到您.

Now, this image will redirect to you on specified URL on click.

从上载S3/投递箱到使用FSCollection(仅适用于节点用户),有很多方法可以实现.

There are many ways to do it from uploading it S3/dropbox to using FSCollection (that's for node users only).

因此,在您的情况下,您的代码段将如下所示,

So in your case, your snippet will look like this,

<a href="http://www.google.com">
 <img src="D:/MOHIT/HTML/images.jpg" />
</a>

这篇关于如何使图片可点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆