<分区>
我的 wordpress 博客中有一个顶部菜单,其中包含 3 个 div:一个用于导航,一个用于社交图标,一个用于搜索栏。
导航 div 覆盖了其他的,所以它们完全失去了它的功能。
如果我为宽度设置一个较低的值,它会改变菜单的整体外观。而且它还有它的移动版本,所以我需要它是 100%。
有什么建议吗?
最佳答案
尝试添加 z-index 属性,见下面的 css 代码:
#MenuFixoTop {
position: relative;
width: 100% !important;
z-index: 1000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
z-index: 0;
}
.nav-search {
padding: 18px 0;
float: right;
margin-right: -293px;
}
@media (min-width: 768px) {
.nav-search {
padding: 18px 0;
float: right;
margin-right: 0;
right: 0;
position: absolute;
}
}
关于html - 导航覆盖其他 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37686763/