I have seen many people ask the opposite, to make the burger menu never appear, even in the small screen sizes, but I can't find how to easily always have the burger menu enabled.
As it normally appears:
This is assuming a standard Bootstrap 3 configuration, as generated by a Visual Studio 2013 Web Application project, so you should not need the standard Visual Studio MVC HTML or the Bootstrap CSS.
As I would prefer it to appear:
From generated master page from a VS 2013 Web Application Project
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<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>
@Html.ActionLink("ProjectName Here", "Index", "Home", null, new { @class = "navbar-brand hidden-xs" })
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.ActionLink("Home", "Index", "Home", new { area = "" }, null)</li>
</ul>
</div>
</div>
</div>
Update:
Obviously a solution using .Less
is perfectly acceptable when using ASP.Net MVC, so you do not have to restrict answers to raw CSS. Recent developments mean adding Bootstrap.less to a project is now trivial via NuGet. In fact most plain CSS answers will suffer from being less maintainable that any solution that reproduces the minimal css from the original source.
I found that @Skelly's solution resulted in the menu collapsing back up straight after opening. (at least with the non-fixed version of the nav). So I wrote some more CSS:
(remove or change media query as desired)
If you don't want to modify the LESS file and re-compile.
You can use this CSS to override Bootstrap's default
navbar
behavior..Using CSS: http://bootply.com/jXxt4Dc54A
UPDATE
This question was recently changed and tagged with LESS. As @cvrebert mentioned when the question was originally asked, the
@grid-float-breakpoint
can be set to a large value if the LESS source is being used.Using LESS: http://www.codeply.com/go/UNFhTH5Hm3
UPDATE for Bootstrap 4
For Bootstrap 4, the new
navbar-expand-*
classes have been added to control the navbar collapse breakpoint. Now the navbar is always collapsed, unless one of thenavbar-expand-*
classes is explicitly used. Therefore no CSS (or SASS variable) changes are necessary to have the hamburger always show.Bootstrap 4: http://www.codeply.com/go/9WCE8jYmW8