nav在调整大小时不显示汉堡包

nav在调整大小时不显示汉堡包

本文介绍了bootstrap 4 nav在调整大小时不显示汉堡包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经知道如何将菜单项向右对齐,但是在调整大小时,导航栏切换开关不会出现.

I've figured how to align the menu items to the right, but when resized the navbar-toggler doesnt appear.

代码:

<nav class="navbar navbar-toggleable-md">
    <a asp-controller="Home" asp-action="Index" class="navbar-brand">
        <img class="brand_img" src="/Graphic/logo.jpg" style="margin-left:-1px;margin-right:6px;" />
        <span class="brand_name">Lundbeck Consulting</span>
    </a>
    <button type="button" class="navbar-toggler navbar-toggler-right" data-toggle="collapse" data-target="#navbarFullCollapse" >
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse justify-content-end" id="navbarFullCollapse">
        <div class="nav navbar-nav">
            <a class="nav-item nav-link navbar_item" asp-controller="Home" asp-action="About">Om LC</a>
            <a class="nav-item nav-link navbar_item" asp-controller="Project" asp-action="Index">Prosjekter</a>
            <a class="nav-item nav-link navbar_item" asp-controller="Home" asp-action="Contact">Kontakt</a>
        </div>
    </div>
</nav>

请参阅 http://core.lundbeckconsulting.no 进行演示

提前谢谢!

推荐答案

已更新2018年

Updated 2018

那里有汉堡包,但是它不可见,因为导航栏需要颜色,或者.

The hamburger is there, but it's not visible because the Navbar needs a color, or change the toggler color.

<nav class="navbar navbar-toggleable-md bg-faded navbar-light">
    ..
</nav>

  • 使用navbar-dark生成浅色/白色链接和切换器
  • 使用navbar-light生成深色/灰色链接和切换器
    • Use navbar-dark to produce light/white colored links and toggler
    • Use navbar-light to produce dark/gray colored links and toggler
    • Bootstrap 4.0.0 中,navbar-toggleable-更改为navbar-expand-,但是navbar-lightnavbar-dark仍然以相同的方式工作...

      In Bootstrap 4.0.0 navbar-toggleable- has changed to navbar-expand-, but navbar-light and navbar-dark still work the same way...

      <nav class="navbar navbar-expand-md navbar-light bg-light">
          ..
      </nav>
      


      另请参阅: Bootstrap导航栏:较小的导航器上没有任何显示设备

      这篇关于bootstrap 4 nav在调整大小时不显示汉堡包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 00:28