Bootstrap:如何提前折叠导航栏 [英] Bootstrap: How to collapse navbar earlier

查看:156
本文介绍了Bootstrap:如何提前折叠导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想折叠我的导航栏在早于768px的分辨率,例如992px,我该怎么做?谢谢! (我知道我可以在引导页面上自定义它,但我不想用新的bootstrap.css文件重新启动我的项目)

I want to collapse my navbar in earlier resolution than 768px, for example 992px, how would I do that? thanks! (I know I can customize it on the bootstrap page, but I don't want to start my project over again with new bootstrap.css file)

推荐答案

这是我的伎俩:

@media (min-width: 768px) and (max-width: 991px) {
    .navbar-collapse.collapse {
        display: none !important;
    }
    .navbar-collapse.collapse.in {
        display: block !important;
    }
    .navbar-header .collapse, .navbar-toggle {
        display:block !important;
    }
    .navbar-header {
        float:none;
    }
}

将它添加到单独的CSS文件中, bootstrap.css

Add this in a separate CSS file and include it after bootstrap.css

这篇关于Bootstrap:如何提前折叠导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆