Bootstrap4 Navbar崩溃溢出。 Express / Node部分

时间:2018-03-27 18:37:38

标签: node.js express handlebars.js bootstrap-4

下面的图片显示了我从引导程序中导航栏崩溃的问题。我正在运行express,node和handlebars。这个标题是部分的。出于某种原因,它不断扩展到div之外,我无法弄清楚原因。  navbar collapse overflow problem

以下是主页面和标题部分的两页代码。在home.hbs我使用CSS网格,不确定是否导致它。

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Home Page</title>
    <link rel="stylesheet" href="/components-font-awesome/css/fontawesome.min.css" />
<link rel='stylesheet' href="/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="css/app.css" />
<script src="/jquery/dist/jquery.min.js"></script>
  </head>
  <body>
    <div class="app">
        <div class="contentContainer">
          <div class="navMenu">
            {{> header}}
          </div>
          <div class="sidebarLeft">
            <!--Add sidebarLeft variable for navigation -->
          </div>
          <div class="content">
            <div>
              <p class="welcome"> Welcome to my portfolio page. </p>
              <p class="clickBelow"> I've been learning Javascript, Python, and Spanish for 7 months
            while living abroad in Mexico.</p>
            <div class="buttonDiv">
              <button class="enter" size="lg">Come take a look</button>
            </div>
          </div>
          </div>
          <div class="sidebarRight">
            <!--Add sidebarRight variable for navigation -->
          </div>
          <div class="footer">
            {{> footer}}
          </div>
        </div>

    </div>
  </body>
    <script src="/bootstrap/dist/bootstrap.min.js"></script>
    <script src="/popper.js/dist/popper.min.js"></script>
</html>

<head>
<link rel="stylesheet" href="/components-font-awesome/css/fontawesome.min.css" />
<link rel='stylesheet' href="/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="css/header.css" />
<script src="/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/jquery/dist/jquery.min.js"></script>
</head>
<div class="container-fluid">
<nav class="navbar navbar-dark navbar-expand-md fixed-top container-flui">
  <a class-"navbar-brand" href="/">Steven</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse"
    data-target="#navbarResponsive" aria-controls="navbarResponsive"
    aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarResponsive">
    <ul class="navbar-nav ml-auto">
      <li class="nav-item active">
        <a class="nav-link" href="/">Home
          <span class="sr-only">(current)</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="/about">About Me</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="/projects">Projects</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="/contact">Contact</a>
      </li>
    </ul>
</nav>

有人知道吗?我尝试过将容器流体添加到多个div中。似乎jquery和bootstrap正在工作。我通过凉亭安装了这些。

1 个答案:

答案 0 :(得分:1)

我遇到的问题是我的网页内容被导航栏重叠,请尝试删除固定顶级属性。