IEs z-index问题

时间:2014-04-19 00:11:13

标签: internet-explorer z-index

在IE(8-10)中,可点击的框未注册,但这适用于Chrome和FF。我的猜测与IEs z索引问题有关。有人可以帮助我指出我能在哪里找到解决方案吗?

http://codepen.io/anon/pen/IFxKH/

HTML:

<div class="wrapper">
  <img src="http://placehold.it/500x500" >

  <div class="box"></div>
</div>

CSS:

.wrapper {
  position: relative;
}
.box {
  width: 30px;
  height: 30px;
  cursor: pointer;
  border: 1px solid red;
  position: absolute;
  top: 100px;
  left: 100px;
  z-index: 9999999999999;
}
.box:hover {
  border-color: blue;
}

请假设这是必须准确标记的方式。将图像作为背景是不可能的。

1 个答案:

答案 0 :(得分:0)

在IE中,鼠标事件不会触发,除非你在div内部有东西。尝试将透明的gif放在盒子里作为img或背景图像,这样可以解决你的问题。