0

Trying to get my navbar to stay collapsed at ipad size. I used the codes from here: Bootstrap 3 Navbar Collapse

But the navbar disappears when I applied the above code (I have max-width at 1200px). The code has this section at the bottom which should prevent the navbar disappearing in Bootstrap 3:

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

However, this code doesn't work for me. So I tried adding collapse.in in the first part of the code where .navbar-collapse.collapse is (line 12).

The navbar now appears, but is not in collapsed state and displays the navbar items in a list, like when a collapsed navbar is clicked. How do I get the navbar to stay collapsed? Thank you.

Community
  • 1
  • 1
Ringo88
  • 15
  • 6
  • Please share some code – Booster Jan 22 '17 at 15:48
  • Hi, my code is based on the free temple Business Casual from Bootstrap: https://startbootstrap.com/template-overviews/business-casual/ I have tried making the original Business Casual's navbar to collapse at ipad with the same codes but it has the same problem. The navbar disappeared at ipad. Thank you. – Ringo88 Feb 04 '17 at 23:21

1 Answers1

0

I had success with this answer from this question.

Within the max-width media query there is no

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

instead it does have the less specific

 .collapse.in{
      display:block !important;
  }
Community
  • 1
  • 1
TT--
  • 2,622
  • 1
  • 24
  • 44
  • Thanks for your help, but the navbar still disappears at ipad size. My codes are based on the free temple Business Casual from Bootstrap: startbootstrap.com/template-overviews/business-casual I have tested the above codes with the original Business Casual and it has the same problem :( Any help will be much appreciated! Thank you. – Ringo88 Feb 04 '17 at 23:24