Skip to content

Instantly share code, notes, and snippets.

@tfausak
Created October 6, 2012 15:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tfausak/3845213 to your computer and use it in GitHub Desktop.
Save tfausak/3845213 to your computer and use it in GitHub Desktop.
Shows Twitter Bootstrap's native support for uncollapsible dropdowns in versions >= 2.0.3.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<title>Bootstrap >= 2.0.3</title>
</head>
<body>
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-bar"></i>
<i class="icon-bar"></i>
<i class="icon-bar"></i>
</a>
<a class="brand" href="#">Bootstrap >= 2.0.3</a>
<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Dropdown
<i class="caret"></i>
</a>
<ul class="dropdown-menu">
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
<li><a href="#">Three</a></li>
</ul>
</li>
</ul>
<div class="nav-collapse">
<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Dropdown
<i class="caret"></i>
</a>
<ul class="dropdown-menu">
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
<li><a href="#">Three</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
@rtpHarry
Copy link

It looks like in Bootstrap 3 you can just remove the .collapse class and hide the button. I just have one item in my menu you though so might have to tweak further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment