我想知道它的教程页面中的bootstrap3下拉菜单系统是如何工作的
1.默认情况下,它全部折叠为主题(您可以单击或向上/向下滚动以展开)
2.当您向上或向下滚动或单击特定菜单时,它会自动扩展
3. 它与主题匹配,并在子菜单中有一些高亮显示
http://getbootstrap.com/css
这个匹配只能用css和html完成,还是必须处理JavaScript?
如果它可以兼顾它使用的套装情况。
答案 0 :(得分:1)
这是引导下拉菜单的PURE CSS解决方案,这里是小提琴
http://jsfiddle.net/DTcHh/1837/
<强> HTML 强>
<nav>
<ul>
<li>
Has Dropdown
<ul>
<li>
Change password </li>
<li>
Edit personal data
</li>
</ul>
</li>
<li>
Support
</li>
<li>
Logout
</li>
</ul>
</nav>
<强> CSS 强>
nav > ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
color: #555;
}
nav > ul li {
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 10px;
background: #fff;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
nav > ul li:hover {
background-color: #e7e7e7;
color: #555;
}
nav > ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
min-width: 225px;
display: none;
opacity: 0;
visibility: hidden;
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.176);
font-size: 14px;
list-style: outside none none;
padding: 5px 0;
text-align: left;
z-index: 10000;
}
nav > ul li ul li {
background-color: transparent;
display: block;
color: #262626;
width:90%;
text-align:left;
padding-left:10px;
padding-right:10px;
text-transform:uppercase;
}
nav > ul li ul li:hover {
background-color: #f5f5f5;
color: #262626;
text-decoration:none;
}
nav > ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
ul li ul a li i{
padding-right:5px;
}
nav ul li ul a li{
color:grey !important;
}
nav ul li ul a{
color:grey;
font-size:12px;
}