我对 div 不是很擅长,如果有任何帮助,我将非常感谢。
我的 div 代码示例
<div class="width" style="background-image: url('someImage.jpg');padding-left:200px;background-repeat:no-repeat;height: 200px;" >
class width 只需将 div 宽度设置为 1000px
我的目标是让图片只能点击,然后将用户重定向到另一个页面。
最佳答案
为什么不对图像使用 标签。
<a href="someURL.com">
<img src="someImage.jpg" />
</a>
关于asp.net - div background_image 中的 onclick 事件,其中图像在 pad_left 的某个位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14879956/