移动bootstrap nav不会打开

时间:2017-09-27 16:42:52

标签: html css twitter-bootstrap bootstrap-4

这是我的index.html页面。当我在移动设备上查看它并单击下拉图标时,没有任何反应。我错过了什么?我从这里得到了模板:https://startbootstrap.com/template-overviews/one-page-wonder/

我已经尝试过查看其他示例,但我在此非常新手,我无法弄清楚如何修复它而不会弄乱其余的代码。

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>Pinching Loaves</title>

<!-- Bootstrap core CSS -->
<link href="bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="one-page-wonder.css" rel="stylesheet">

<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
  <div class="container">
    <a class="navbar-brand" href="#">Handmade Loaves & Pastries</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="http://www.pinchingloavesga.com/index.html">Home
            <span class="sr-only">(current)</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="http://www.pinchingloavesga.com/bakes.html">Bakes</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="http://www.pinchingloavesga.com/contact.html">Contact Us</a>
        </li>
      </ul>
    </div>
  </div>
</nav>

<header class="masthead">
  <div class="overlay">
    <div class="container">
      <h1 class="display-1 text-black"></h1>

    </div>
  </div>
</header>

<section>
  <div class="container">
    <div class="row align-items-center">
      <div class="col-md-6 order-2">
        <div class="p-5">
          <img class="img-fluid rounded-circle" src="http://s3.amazonaws.com/fw-wp-images/wp-content/uploads/2017/05/baguettes.jpg" alt="">
        </div>
      </div>
      <div class="col-md-6 order-1">
        <div class="p-5">
          <h2 class="display-4"><a href="http://www.pinchingloavesga.com/bakes.html">Fresh Bakes</a></h2>
          <p>We bake fresh loaves and pastries daily! Take a look at some of our best sellers and specialty breads</p>
        </div>
      </div>
    </div>
  </div>
</section>

<section>
  <div class="container">
    <div class="row align-items-center">
      <div class="col-md-6">
        <div class="p-5">
          <img class="img-fluid rounded-circle" src="https://static.pexels.com/photos/3564/bread-breakfast-baguette-sliced.jpg" alt="">
        </div>
      </div>
      <div class="col-md-6">
        <div class="p-5">
          <h2 class="display-4">Markets!</h2>
          <p>Check here regularly to see where our next Farmer's Market appearance will be!</p>
        </div>
      </div>
    </div>
  </div>
</section>

<section>
  <div class="container">
    <div class="row align-items-center">
      <div class="col-md-6 order-2">
        <div class="p-5">
          <img class="img-fluid rounded-circle" src="https://static.pexels.com/photos/9510/food-pizza-kitchen-recipe.jpg" alt="">
        </div>
      </div>
      <div class="col-md-6 order-1">
        <div class="p-5">
          <h2 class="display-4">About Us</h2>
          <p>About us description</p>
        </div>
      </div>
    </div>
  </div>
</section>

<!-- Footer -->
<footer class="py-5 bg-dark">
  <div class="container">
    <p class="m-0 text-center text-white">Copyright &copy; Pinching Loaves 2017</p>
  </div>
  <!-- /.container -->
</footer>

<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/popper/popper.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>

2 个答案:

答案 0 :(得分:0)

您的模板没有下拉列表的功能。要显示下拉菜单,请参阅

  

https://getbootstrap.com/docs/4.0/components/dropdowns/

用于下拉模板。使用此更改菜单模板。

答案 1 :(得分:0)

这是您的模板和下拉菜单也正常工作 检查一下

&#13;
&#13;
    <!-- Bootstrap core CSS -->
    <link href="https://blackrockdigital.github.io/startbootstrap-one-page-wonder/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="https://blackrockdigital.github.io/startbootstrap-one-page-wonder/css/one-page-wonder.css" rel="stylesheet">

    <!-- Navigation -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
      <div class="container">
        <a class="navbar-brand" href="#">Start Bootstrap</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</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">Services</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">Contact</a>
            </li>
          </ul>
        </div>
      </div>
    </nav>

    <header class="masthead">
      <div class="overlay">
        <div class="container">
          <h1 class="display-1 text-white">One Page Wonder</h1>
          <h2 class="display-4 text-white">Will Rock Your Socks Off</h2>
        </div>
      </div>
    </header>

    <section>
      <div class="container">
        <div class="row align-items-center">
          <div class="col-md-6 order-2">
            <div class="p-5">
              <img class="img-fluid rounded-circle" src="https://unsplash.it/500/500?image=836" alt="">
            </div>
          </div>
          <div class="col-md-6 order-1">
            <div class="p-5">
              <h2 class="display-4">For those about to rock...</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod aliquid, mollitia odio veniam sit iste esse assumenda amet aperiam exercitationem, ea animi blanditiis recusandae! Ratione voluptatum molestiae adipisci, beatae obcaecati.</p>
            </div>
          </div>
        </div>
      </div>
    </section>

    <section>
      <div class="container">
        <div class="row align-items-center">
          <div class="col-md-6">
            <div class="p-5">
              <img class="img-fluid rounded-circle" src="https://unsplash.it/500/500?image=452" alt="">
            </div>
          </div>
          <div class="col-md-6">
            <div class="p-5">
              <h2 class="display-4">We salute you!</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod aliquid, mollitia odio veniam sit iste esse assumenda amet aperiam exercitationem, ea animi blanditiis recusandae! Ratione voluptatum molestiae adipisci, beatae obcaecati.</p>
            </div>
          </div>
        </div>
      </div>
    </section>

    <section>
      <div class="container">
        <div class="row align-items-center">
          <div class="col-md-6 order-2">
            <div class="p-5">
              <img class="img-fluid rounded-circle" src="https://unsplash.it/500/500?image=453" alt="">
            </div>
          </div>
          <div class="col-md-6 order-1">
            <div class="p-5">
              <h2 class="display-4">Let there be rock!</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod aliquid, mollitia odio veniam sit iste esse assumenda amet aperiam exercitationem, ea animi blanditiis recusandae! Ratione voluptatum molestiae adipisci, beatae obcaecati.</p>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- Footer -->
    <footer class="py-5 bg-dark">
      <div class="container">
        <p class="m-0 text-center text-white">Copyright &copy; Your Website 2017</p>
      </div>
      <!-- /.container -->
    </footer>
    
      <!-- Bootstrap core JavaScript -->
    <script src="https://blackrockdigital.github.io/startbootstrap-one-page-wonder/vendor/jquery/jquery.min.js"></script>
    <script src="https://blackrockdigital.github.io/startbootstrap-one-page-wonder/vendor/popper/popper.min.js"></script>
    <script src="https://blackrockdigital.github.io/startbootstrap-one-page-wonder/vendor/bootstrap/js/bootstrap.min.js"></script>
&#13;
&#13;
&#13;