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;,問題就得到解決。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM