html – Bootstrap navbar-toggler-icon不可见但功能正常

前端之家收集整理的这篇文章主要介绍了html – Bootstrap navbar-toggler-icon不可见但功能正常前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图将我的bootstrap导航栏实现到我的把手布局文件中.我注意到引导程序发生了一些奇怪的事情,这也不例外.一旦我将窗口缩小到navbar-toggler-icon应该显示的大小,它就不可见了,但它仍然在那里运行,就像它应该,我只是看不到它.

这是我的整个layout.hbs类:

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- required Meta tags -->
    <Meta charset="utf-8">
    <Meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
    <link rel="stylesheet" href="/stylesheets/style.css">
  </head>
  <body>
    <nav id="navigation" class="navbar navbar-inverse">
      <a class="navbar-brand" href="#">Navbar</a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>

      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
          <li class="nav-item active">
            <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
          </li>
        </div>
    </nav>
    {{{body}}}
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
  </body>
</html>

这是一个发生什么的例子:
Picture of whats happening
我被告知将我的导航栏类改为navbar-inverse会使它出现,但我也没有运气.

解决方法

尝试使用navbar navbar-light而不是navbar navbar-inverse.

Bootstrap 4是对较旧的Bootstrap的重大改写,并且已经改变了

Bootstrap Migration guide

原文链接:https://www.f2er.com/html/223904.html

猜你在找的HTML相关文章