try it
ul {
position: relative;
}
li ul {
position: absolute;
z-index: -2;
}
In other words, delete z-indexfor the parent and give the child a negative z-index. This causes the submenu to fail to overlap, although something about negative z-indexes seems wrong.
source
share