Change bootstrap navbar collapse breakpoint without using LESS

前端 未结 19 2216
囚心锁ツ
囚心锁ツ 2020-11-22 07:55

Currently when the browser width drops below 768px, the navbar changes to collapsed mode. I want to change this width to 1000px so when the browser is below 1000px the navba

19条回答
  •  感情败类
    2020-11-22 08:41

    This worked for me Bootstrap3

    @media (min-width: 768px) {
        .navbar-header {
              float: none;
          }
          .navbar-toggle {
              display: block;
          }
          .navbar-collapse {
              border-top: 1px solid transparent;
              box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
          }
          .navbar-collapse.collapse {
              display: none!important;
          }
          .navbar-collapse.collapse.in {
              display: block!important;
          }
          .navbar-nav {
              float: none!important;
              margin: 7.5px -15px;
          }
          .navbar-nav>li {
              float: none;
          }
          .navbar-nav>li>a {
              padding-top: 10px;
              padding-bottom: 10px;
          }
    }
    

    Took a while to figure these two out:

    .navbar-collapse.collapse {
       display: none!important;
    }
    .navbar-collapse.collapse.in {
       display: block!important;
    }
    

提交回复
热议问题