我想在响应式导航中添加水平分隔线。这是移动设备上的bootstrap响应视图。
我想在最后两个菜单项之间添加一个分隔符,即“link”和“dropdown”菜单项。如果我添加以下<li class='divider></li>'
答案 0 :(得分:6)
您必须编写如下的@media查询:
See Divider in Browser- Resize browser to check
JSFiddle with Divider in collapsible nav
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) {
.nav-collapse .nav > li.divider {
*width: 100%;
height: 1px;
margin: 9px 1px;
*margin: -5px 0 5px;
overflow: hidden;
background-color: #e5e5e5;
border-bottom: 1px solid #ffffff;
}
}
@media (min-width: 600px){
.nav-collapse .nav > li.divider {
*width: 100%;
height: 1px;
margin: 9px 1px;
*margin: -5px 0 5px;
overflow: hidden;
background-color: #e5e5e5;
border-bottom: 1px solid #ffffff;
}
}
/* Landscape phones and down */
@media (max-width: 480px) {
.nav-collapse .nav > li.divider {
*width: 100%;
height: 1px;
margin: 9px 1px;
*margin: -5px 0 5px;
overflow: hidden;
background-color: #e5e5e5;
border-bottom: 1px solid #ffffff;
}
}
答案 1 :(得分:3)
为什么不<hr>
或<legend></legend>
?
<li class = ""></li>
<li class = ""></li>
<div class = "visible-phone">
<legend></legend>
</div>
<li class = ""></li>
<li class = ""></li>