Header with logo

Bootstrap 5 Header with logo component

Responsive Header with logo built with Bootstrap 5. Simple examples of navigation headers with logo. Easy to implement and customize.


Basic example

Set a height via attribute to your logo to provide a proper positioning within the Navbar.

Example below: height="30"

        
            
                <!-- Just an image -->
                <nav class="navbar navbar-light bg-body-tertiary">
                    <div class="container">
                        <a class="navbar-brand" href="#">
                            <img src="https://mdbcdn.b-cdn.net/img/logo/mdb-transaprent-noshadows.webp" 
                                 height="30" 
                                 alt="MDB Logo" 
                                 loading="lazy" />
                        </a>
                    </div>
                </nav>
                
        
    

You can also use text and place it inside the .navbar-brand element.

        
            
                <!-- As a link -->
                <nav class="navbar navbar-light bg-body-tertiary">
                    <div class="container-fluid">
                        <a class="navbar-brand" href="#">MDB</a>
                    </div>
                </nav>

                <!-- As a heading -->
                <nav class="navbar navbar-light bg-body-tertiary">
                    <div class="container-fluid">
                        <span class="navbar-brand mb-0 h1">MDB</span>
                    </div>
                </nav>
                
        
    

Jumbotron

A jumbotron is a lightweight, flexible component that can optionally extend the entire viewport to showcase key marketing messages on your site.

Replace heading (<h1> text) with an image to get header with logo.

        
            
                <header>
                    <!-- Navbar -->
                    <nav class="navbar navbar-expand-lg navbar-light bg-white">
                        <div class="container-fluid">
                            <button data-mdb-button-init class="navbar-toggler" type="button" data-mdb-collapse-init data-mdb-target="#navbarExample01" 
                            aria-controls="navbarExample01" aria-expanded="false" aria-label="Toggle navigation">
                                <i class="fas fa-bars"></i>
                            </button>
                            <div class="collapse navbar-collapse" id="navbarExample01">
                                <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                                    <li class="nav-item active">
                                        <a class="nav-link" aria-current="page" href="#">Home</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" href="#">Features</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" href="#">Pricing</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" href="#">About</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </nav>
                    <!-- Navbar -->

                    <!-- Jumbotron -->
                    <div class="p-5 text-center bg-body-tertiary">
                        <h1 class="mb-3">
                            <img src="https://mdbcdn.b-cdn.net/img/logo/mdb-transaprent-noshadows.webp" 
                                 height="50" 
                                 alt="MDB Logo" 
                                 loading="lazy" />
                        </h1>
                        <h4 class="mb-3">Subheading</h4>
                        <a data-mdb-ripple-init class="btn btn-primary" href="" role="button">Call to action</a>
                    </div>
                    <!-- Jumbotron -->
                </header>