IE10锚标签z索引问题 [英] IE10 anchor tag z-index issue
问题描述
在IE 10中,我有一个相对定位的包装div,有一些内容(图像/文本)。在该div内部是一个绝对定位的锚标签,它被定位为覆盖整个包装器div。它有一个z索引集。因此,封装div内的整个区域应该是可点击的。但是,只有包装器div中没有内容的区域才可点击。整个包装器div可以在所有其他浏览器中点击,除了IE 10.这里是一个小提琴: http:// jsfiddle。 net / NUyhF / 3 / 。帮助?
In IE 10, I have a relatively positioned wrapper div with some content (an image / text). Inside of that div is an absolutely positioned anchor tag which is positioned to "cover" the entire wrapper div. It has a z-index set. So the entire area inside the wrapper div should be clickable. However, only the areas in the wrapper div that don't have content are clickable. The entire wrapper div is clickable in all other browsers except for IE 10. Here is a fiddle: http://jsfiddle.net/NUyhF/3/. Help?
<div class="wrapper">
<div class="imgWrapper">
<img src="http://www.google.com/images/srpr/logo4w.png" />
</div>
<p>Here is some text</p>
<a href="#"></a>
</div>
.wrapper { position : relative; width: 500px; height: 300px; }
.wrapper a { position: absolute; top: 0px; width: 500px; height: 300px; z-index: 2; }
推荐答案
我发现这是一个恼人的特性IE一段时间,为了解决它我不得不做一个透明的图像,并使用它作为锚标签的背景:
I have found this to be an annoying trait of IE for some time, to solve it I had to make a transparent image and use it as the background of the anchor tag:
background:url(transparent1x1.gif) repeat;
这篇关于IE10锚标签z索引问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!