Bootstrap navbar: nothing is displayed on smaller devices

后端 未结 1 1900
挽巷
挽巷 2020-11-30 15:35

This nav bar with logo image in the middle works really well on larger screens but on smaller screens, everything disappears including logo image (and the hamburger fails to

相关标签:
1条回答
  • 2020-11-30 16:18

    It's there but you're not seeing because there is no background-color..

    Use the navbar-default navbar-light or navbar-dark class:

    <nav id="navbar-primary" class="navbar navbar-light bg-light" role="navigation">

    or, add a background color:

    #navbar-primary .navbar-nav { 
       background: #ededed;
    }
    

    or, darken the toggler:

    .navbar-toggle .icon-bar {
        background-color: rgb(136, 136, 136);
    }
    

    https://www.codeply.com/go/QGDVIsAeda

    Update for Bootstrap 4.0.0

    navbar-default is gone. Now use navbar-light bg-light of for a light colored navbar, or navbar-dark bg-dark for a dark colored navbar.


    Also see: Bootstrap 4 Change Hamburger Toggler Color

    0 讨论(0)
提交回复
热议问题