Open In App
Related Articles

How to Align navbar logo to the left screen using Bootstrap ?

Improve Article
Save Article
Like Article

It is very easy in Bootstrap to align items left and right by using the bootstrap classes. By default, it sets to left. If you want to align items center or right then it will be done by yourself. To align the navbar logo to the left of the screen with the Bootstrap method is a quick trick that can save you from writing extra CSS. In this, we simply add another div tag above the div tag having class navbar navbar-expand-lg navbar-light bg-light fixed-top py-lg-0.


<!DOCTYPE html>
        How to Align navbar logo to the 
        left screen using Bootstrap ?
    <link href=
            rel="stylesheet" integrity=
    <script src="" integrity=
    <script src=
    <!-- NAVBAR STARTING -->
    <!-- Use navbar class to the navbar logo 
        to the far left of the screen-->
    <nav class=" navbar navbar-expand-lg 
        navbar-light bg-light fixed-top py-lg-0 ">
        <a class="navbar-brand" href="#">
            <!-- Add logo with size of 90*80 -->
            <img src=
            width="90" height="80" alt="">
        <button class="navbar-toggler" type="button"
                aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
        <div class="collapse navbar-collapse"
            <ul class="navbar-nav ml-auto">
                <li class="nav-item active">
                    <a class="nav-link" href="#">Home
                        <span class="sr-only">(current)</span>
                <li class="nav-item">
                    <a class="nav-link" href="#">About</a>
                <li class="nav-item">
                    <a class="nav-link" href="#">Courses</a>
                <li class="nav-item">
                    <a class="nav-link" href="#">Contact</a>


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 01 Jun, 2020
Like Article
Save Article
Similar Reads
Complete Tutorials