Change bootstrap navbar collapse breakpoint without using LESS

前端 未结 19 2561
囚心锁ツ
囚心锁ツ 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:32

    You have to write a specific media query for this, from your question, below 768px, the navbar will collapse, so apply it above 768px and below 1000px, just like that:

    @media (min-width: 768px) and (max-width: 1000px) {
       .collapse {
           display: none !important;
       }
    }
    

    This will hide the navbar collapse until the default occurrence of the bootstrap unit. As the collapse class flips the inner assets inside navbar collapse will be automatically hidden, like wise you have to set your css as you desired design.

提交回复
热议问题