我越來越討厭一個小問題。當我修改我的按鈕的z-index css屬性(在滾動時它們重疊在我的頂部導航欄和頁腳上)時,它們不是可點擊是的,就像按鈕上有東西。我怎麼解決這個問題?Z-index按鈕不可點擊
這是我的按鈕:
<button class="btn waves-effect waves-light"><i class="small material-icons">add</i></button>
這是CSS:
.waves-effect {
position: relative;
cursor: pointer;
display: inline-block;
overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
vertical-align: middle;
z-index: 0;
transition: .3s ease-out;
}
materialize3.css:5259
.btn, .btn-large {
text-decoration: none;
color: #fff;
background-color: #0091ea;
text-align: center;
letter-spacing: .5px;
transition: .2s ease-out;
cursor: pointer;
margin-left: 5px;
}
materialize3.css:5241
.btn, .btn-large, .btn-floating, .btn-large, .btn-flat {
font-size: 1rem;
outline: 0;
}
materialize3.css:5187
.btn, .btn-large, .btn-flat {
border: none;
border-radius: 2px;
display: inline-block;
height: 36px;
line-height: 36px;
padding: 0 2rem;
text-transform: uppercase;
vertical-align: middle;
-webkit-tap-highlight-color: transparent;
發佈您的代碼。看看如何創建一個[mcve] –
我現在發佈了它 –
如果我將z-index更改爲'-1',該按鈕不再有效@ j08691 –