可折叠侧边栏,带顶部导航

时间:2019-08-09 16:11:55

标签: css twitter-bootstrap bootstrap-4

我找到了这个基本的Bootstrap仪表板模板,但是在移动设备上时没有切换图标。有谁知道如何更改它以在大屏幕上保留侧边栏,并在移动设备上将相同的侧边栏隐藏在切换按钮(汉堡菜单)下?

模板:https://getbootstrap.com/docs/4.1/examples/dashboard/#

1 个答案:

答案 0 :(得分:1)

尝试使用给定的引导程序4类 我是这样的:

<!-- Start Navigation -->
<nav class="navbar navbar-expand-lg">

  <!-- Start Container -->
  <div class="container">

    <!-- This Button is for the toggled navigation -->
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <!-- Start Toggle -->
    <div class="collapse navbar-collapse" id="navbarTogglerDemo02">
      <ul class="navbar-nav mr-auto">
        <li class="nav-item"><a class="nav-link" href="#"YOUR SITE</a></li>
      </ul>
    </div>
    <!-- End Toggle -->

  </div>
  <!-- End Container -->

</nav>
<!-- End Navigation -->