Open In App

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

Last Updated : 01 Jun, 2020
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>


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads