【问题标题】:A Href with Image not working in IE带有图像的 Href 在 IE 中不起作用
【发布时间】:2012-04-28 22:34:47
【问题描述】:

没有列出类似问题的解决方案:image inside href link not working in ie7

我的图片链接在 ie9 中无法使用,但在 Firefox 和 Chrome 中可以完美使用。 我知道问题在于 ie 对嵌套 div 的处理方式。当我删除它时,链接有效,但我希望它标准化图像所在的框。

<a href='http://www.weflect.com/obj_photos.php?obj_name=Christopher+Nolan&obj_id=1000003100634240'>
   <div class='img_m2'>
      <img class='size_m2' alt='Christopher Nolan' src='http://s3.amazonaws.com/weflect-objects/1000003100634240-f741bdae22811aa18cb2b22eb395d404-35323-m2.jpg'/>
   </div>
</a>

可以查看直播网站:http://www.weflect.com/object/Christopher+Nolan/1000003100634240//

此外,通过在 div 中放置“a href”来交换顺序不是一种选择,因为我希望能够将不同的链接位置设置为同一个图像。我可以解决它以将链接 url 传递给 obj_img 函数,但宁愿不这样做。这个问题还有其他答案吗?

【问题讨论】:

  • onclick='window.open()'添加到图像中,并在图像上更改光标。
  • “标准化盒子”是什么意思?为什么不对链接中的图片进行标准化?
  • 简单的答案就是我在问题中提到的:将您的 放在
    中:
    应该很容易切换你的代码来做到这一点。感谢失望先生提出正确的问题,让我思考为什么我需要它。但是吸取了教训,IE 不喜欢
    顺序。

标签: image html hyperlink internet-explorer-9


【解决方案1】:
   <div class='img_m2'>
<a href='http://www.weflect.com/obj_photos.php?obj_name=Christopher+Nolan&obj_id=1000003100634240'>
      <img class='size_m2' alt='Christopher Nolan' src='http://s3.amazonaws.com/weflect-objects/1000003100634240-f741bdae22811aa18cb2b22eb395d404-35323-m2.jpg'/>
</a>
   </div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-14
    • 2018-06-20
    • 2014-09-07
    • 2017-10-01
    • 1970-01-01
    • 2019-11-02
    • 2011-11-05
    • 2014-08-09
    相关资源
    最近更新 更多