我正在嘗試創建一個設置,其中包含導航欄,導航欄內的可摺疊菜單以及網站內容。當主菜單下拉菜單關閉時,子菜單鏈接仍然可點擊
很抱歉的壞榜樣,但有點像這樣:https://jsfiddle.net/2nqchLpf/
正如你可以看到,如果你將鼠標懸停在子菜單鏈接時,下拉未展開,你仍然可以點擊它們。
如何獲取顯示在內容後面的鏈接,同時讓導航欄顯示所有內容?
我已經申請z-index
這樣的:
.navbar {
position: fixed;
z-index: 1000;
}
.big-dropdown {
position: absolute;
z-index: -1;
}
#content {
position: relative;
z-index: 999;
}
bleh謝謝你的問題編輯。這很容易申請,無需改變其他任何東西。奇蹟般有效!! –