我差不多完成了我的菜单。但是我有两个问题。
这是我的CSS:
#nav li ul {
opacity: 0;
height: 0px;
}
#nav li a {
font-style: normal;
font-weight: 400;
position: relative;
display: block;
padding: 16px 25px;
color: #fff;
white-space: nowrap;
z-index: 2;
text-decoration: none
}
#nav li a:hover {
color: #c0392b;
background-color: #ecf0f1;
}
#nav ul li {
background-color: #e74c3c;
color: #fff;
display: block;
list-style: disc;
}
#nav li:first-child {
border-top: 1px solid #fff;
}
#nav ul {
margin: 0;
padding: 0;
}
#nav .fa { margin: 0px 17px 0px 0px; }
.logo {
width: 100%;
padding: 21px;
margin-bottom: 20px;
box-sizing: border-box;
}
#logo{
color: #fff;
font-size: 30px;
font-style: normal;
}
.sidebar-icon {
position: relative;
float: right;
text-align: center;
line-height: 1;
font-size: 25px;
padding: 6px 8px;
color: #fff;
}
.disp {
opacity: 1!important;
height:auto!important;
transition: height 100ms ease-in-out;
transition-delay: 300ms;
}
#nav li span:first-child {
margin-left: 32px;
}
asdasdasdasdasdasdasdassa
答案 0 :(得分:1)
好吧,首先删除它:
#nav li:not(:last-child) {
border-bottom: 1px solid #fff;
}
为所有li
添加边框,即使是最后一个:
#nav li {
border-bottom: 1px solid #fff;
}
删除scroll
执行此操作:
<强> JS:强>
$('body, html').toggleClass('OverflowHidden');
<强> CSS:强>
.OverflowHidden {
overflow: auto;
}
并删除双边框使用:
#nav li ul li:last-child {
border-bottom: none!important;
}
<强> jsFiddle 强>