Bootstrap class: .navbar-dark bg-dark

<nav class="navbar navbar-dark bg-dark">
  <!-- Navbar content -->
</nav>

<nav class="navbar navbar-dark bg-primary">
  <!-- Navbar content -->
</nav>

Preview

More in Bootstrap Navbar