📜  bootstrap-navbar-brand - CSS (1)

📅  最后修改于: 2023-12-03 14:59:33.589000             🧑  作者: Mango

Bootstrap Navbar Brand

Bootstrap Navbar Brand is a class used to create a brand logo or name for a navigation bar.

Usage

The navbar-brand class is typically used within a div element that sets up the navigation bar.

<nav class="navbar navbar-expand-lg navbar-light bg-light">
 <div class="container-fluid">
   <a class="navbar-brand" href="#">My Brand</a>
   <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
     <span class="navbar-toggler-icon"></span>
   </button>
   <div class="collapse navbar-collapse" id="navbarNav">
     <ul class="navbar-nav">
       <li class="nav-item">
         <a class="nav-link active" aria-current="page" href="#">Home</a>
       </li>
       <li class="nav-item">
         <a class="nav-link" href="#">About</a>
       </li>
       <li class="nav-item">
         <a class="nav-link" href="#">Contact</a>
       </li>
     </ul>
   </div>
 </div>
</nav>
Customization

The navbar-brand class can be customized using CSS. For example, to change the font size, color and weight of the brand text, you can add the following CSS rule:

.navbar-brand {
    font-size: 1.5rem;
    color: #333;
    font-weight: bold; 
}
Conclusion

Using Bootstrap Navbar Brand makes it easy to include a brand logo or name in your navigation bar. By customizing the class using CSS, you can further enhance the look and feel of the brand.