html - 手机上的 Twitter Bootstrap 菜单样式

标签 html css twitter-bootstrap

我正在使用 Twitter Bootstrap ,我的菜单当前显示如下: menu 这是完美的,但我需要在移动 View 中显示如下菜单: enter image description here

现在我知道我需要使用媒体查询,这不是问题,问题是如何在 CSS 中让我的菜单样式像线条等...?

这是 HTML:

<!--SUBMENU-->
<div class="row-fluid">
   <div class="span12 submenu">
       <ul class="nav menu nav-pills">
            <li class="item-109"><a href="/stradix/index.php/company-profile" >Company Profile</a></li>
            <li class="item-108"><a href="/stradix/index.php/due-diligence" >Due Diligence</a></li>
            <li class="item-110"><a href="/stradix/index.php/our-solution" >Our Solution</a></li>
            <li class="item-111"><a href="/stradix/index.php/loan-process" >Loan Process</a></li>
            <li class="item-112"><a href="/stradix/index.php/currency-converter" >Currency Converter</a></li>
            <li class="item-113"><a href="/stradix/index.php/loan-calculator" >Loan Calculator</a></li>
            <li class="item-114"><a href="/stradix/index.php/news" >News</a></li>
            <li class="item-115"><a href="/stradix/index.php/important-downloads" >Downloads</a></li>
        </ul>
    </div>
</div>
<!--SUBMENU-->

和覆盖默认 Bootstrap 的 CSS:

.submenu .nav-pills > li > a {
    font-size:1.25em; 
    padding:0; 
    margin:2em 0.9em 0 0;
    padding: 0 0.9em 0 0;
    color:#6D6E70; 
    border-right:1px solid #A7A9AB;
    border-radius:0;
}
.submenu .nav-pills a:hover {
    background:none;
    color:#00ADEE;
}
.submenu .nav-pills > .active > a {
    background:none;
    color:#00ADEE;
}

.submenu .nav-pills > li:last-child > a {
        border-right:none;
        padding: 0;
        margin-right:0;
}

我会在 JSFIDDLE 上发布它,但由于某种原因,自周五以来我仍然无法连接到 jsfiddle..

非常感谢任何帮助.. 谢谢。

最佳答案

你可以这样做来达到预期的效果

@media (max-width: 480px) { 

 .nav-pills > li {
float: left;
width: 50%;
 }
}

查看 my JSFiddle for an example

关于html - 手机上的 Twitter Bootstrap 菜单样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15598925/

相关文章:

twitter-bootstrap - 使用 Angular 4 和 Bootstrap 4 在底部设置页脚(适应内容)

html - Bootstrap Yamm Navbar 悬停时出现故障

javascript - 当元素位于窗口顶部时添加类

javascript - Meteor JS 报错

css - z-index 不适用于 :before 跨度

css - 网格位置问题

javascript - 类点击不会触发

html div 背景图片不显示

html - 为什么第二个元素不会在 div 中居中?

html - Bootstrap 布局内容表单元素超出列