Non-responsive navbar with Bootstrap 3

前端 未结 2 1694
栀梦
栀梦 2020-12-15 01:21

This is the paragraph from Bootstrap 3 documentation about disabling responsivness for a navbar:

If using navbars, undo all the navbar collapsing and

相关标签:
2条回答
  • 2020-12-15 01:29

    Well, the key appears to be building a stylesheet that locks out all of the responsive stuff. Take a look at http://getbootstrap.com/examples/non-responsive/non-responsive.css for what they use to stop the page from being responsive. You could probably lift that entire sheet.

    Regarding the navbar specifically, there is nothing that you can do without having a sheet like the one linked in this answer. That being said, the one thing the example doesn't do that you probably should is rip out the menu icon that will show up when the navbar collapses. That would be this bit of code:

    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    
    0 讨论(0)
  • 2020-12-15 01:52

    Check this: https://github.com/bassjobsen/non-responsive-tb3 and also read https://github.com/twbs/bootstrap/issues/10371.

    You can do this by setting the @grid-float-breakpoint to 0 in your variables.less. And recompile bootstrap.

    update As mentioned in the comments by @fred-k the above did not make the navbar dropdowns non-responsive. To fix this you will have to set @screen-xs-max in navbar.less to 0 too. This issue will be fixed in future releases, see https://github.com/twbs/bootstrap/pull/10465

    Note @screen-xs-max in navbar.less also influence the Navbar forms

    0 讨论(0)
提交回复
热议问题