How to disable stacking of bootstrap justified tabs on small screens

后端 未结 9 2176
我寻月下人不归
我寻月下人不归 2020-12-24 06:51

I have seen this post, but being a new user I can\'t comment to ask for clarification.

I\'m using the justified nav tabs in Bootstrap and don\'t want them to stack o

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-24 07:33

    Other simple solution is to add flex class to

      element instead of nav-justified

      .just {
        display: flex;
        flex-flow: row nowrap;
      }
      
      .just > li {
        flex: 1 auto;
        text-align: center;
        white-space: nowrap;
      }
      

      jsFiddle
      Note that in case of many tabs, some of them may go behind your screen. To prevent this you can add wrap instead of nowrap to the flex flow. That way they will indeed get stacked but only in case when things would normally get behind screen, meaning breakpoint for warp stacking is smaller than in case of nav-justified. Go ahead and use row wrap on my Fiddle and resize screen to see what I am talking about.

提交回复
热议问题