我目前正在建設一個網站,真的很喜歡我的「4位置」下拉菜單工作。但導航菜單與其重疊。我最初的想法是,我們Z-index將它堆疊在主導航之上,但它不起作用。我能做什麼??查看它:去http://pcfm.adamerica.me/Z-索引不工作,使div包含下拉菜單重疊導航
這是CSS:
/* Dropdown Button */
.location-dropbtn {
background-color: #4CAF50;
color: white;
padding: 10px;
font-size: 12px;
border: none;
cursor: pointer;
}
/* Dropdown button on hover & focus */
.location-dropbtn:hover, .location-dropbtn:focus {
background-color: #3e8e41;
}
/* The container div - needed to position the dropdown content */
.location-dropdown {
position: absolute;
display: inline-block;
margin-top: -10px;
margin-left: 20px;
margin-right: 20px;
z-index: 110001;
}
/* Dropdown Content (Hidden by Default) */
.location-dropdown-content {
display: none;
position: absolute;
background-color: #4CAF50;
color: #ffffff;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 110001;
}
/* Links inside the dropdown */
.location-dropdown-content a {
color: #ffffff;
font-size: 12px;
padding: 12px 16px;
text-decoration: none;
display: block;
z-index: 110001;
}
/* Change color of dropdown links on hover */
.location-dropdown-content a:hover {
background-color: #3e8e49
}
/* Show the dropdown menu */
.show {
display:block;
z-index: 110001;
}