经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » HTML/CSS » CSS » 查看文章
div添加cursor:pointer;失效问题。
来源:cnblogs  作者:龚·昭繇  时间:2019/1/16 9:05:55  对本文有异议

如果你不小心给其它盒子设置了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;,问题就得到解决。

 友情链接:直通硅谷  点职佳  北美留学生论坛