.navbar-toggle - Styles the button that should open the navbar on small screens. - HTML CSS Bootstrap Class List

HTML CSS examples for Bootstrap Class List:navbar-toggle

Introduction

You can remove the .navbar-expand-md class to hide navbar links and display the toggler button.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script>
</head><!--from   www. ja  v a2  s.co m-->
<body>

<nav class="navbar navbar-expand-md bg-dark navbar-dark">
  <a class="navbar-brand" href="#">Navbar</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="collapsibleNavbar">
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
    </ul>
  </div>
</nav>
<br>

<div class="container">
  <h3>Collapsible Navbar</h3>
  <p>This is a test. This is a test. This is a test.This is a test. This is a test. This is a test.
  This is a test. This is a test. This is a test.This is a test. This is a test. This is a test.
  This is a test. This is a test. This is a test.This is a test. This is a test. This is a test.
  This is a test. This is a test. This is a test.This is a test. This is a test. This is a test.
  This is a test. This is a test. This is a test.This is a test. This is a test. This is a test.
  This is a test. This is a test. This is a test.This is a test. This is a test. This is a test.
  </p>
</div>

</body>
</html>

Related Tutorials