div添加cursor:pointer;失效问题。

如果你不小心给其它盒子设置了z-index属性显示在最上层而又没有将该盒子进行隐藏。

<style>
.bottom {
position: absolute;
width:100px;
height:100px;
background:pink;
cursor:pointer;
}
.top {
z-index:999;
width:200px;
height:200px;
background-color: transparent;
position: absolute;
}
</style>
<div class="top"></div>
<div class="bottom"></div>

那么这是给看到的盒子设置cursor属性时无效,将设置了z-index的最上层盒子设置display:none;,问题就得到解决。

posted @ 2019-01-15 17:57  秋华啦啦  阅读(15013)  评论(1编辑  收藏  举报