css - 导航栏未显示在网站的第二页上

标签 css html bootstrap-4 nav

我已经让这个导航栏在我的登陆页面上工作,我希望它在第二页上看起来也一样,但它没有显示。我不确定我做错了什么,因为我只是从第一页复制/粘贴。

这可能只是遗漏了一些小东西,但我已经盯着它看了一会儿,似乎无法弄清楚。

这是我的第二个页面的代码,它不会显示在上面。

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Reservations</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="stylesheet" type="text/css" href="reservations.css">
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
   <link rel="icon" href="travel.png">
</head>
<body>
<style>
  h1 {
   color: black;
   text-align: center;
  }
 .form-group {
   width: 400px;
   text-align: justify;
 }
body {
  background-color: #DCDCDC;
}

</style>
 <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
  <div class="container">
    <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="travelindex.html">Home
                <span class="sr-only">(current)</span>
              </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="reservations.html">Reservations</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="aboutus.html">About Us</a>
        </li>
      </ul>
    </div>
  </div>
</nav>

  <h1><strong>Reservation Information</strong></h1>
    <form action="contactform.php" method="post" id="reservationform">

    <div class="form-group">
      <label for="name">Name</label>
      <input type="text" name="name" id="name" class="form-control">
    </div>

    <div class="form-group">
      <label for="email">Email</label>
      <input type="text" name="email" id="email" class="form-control">
    </div>

    <div class="form-group">
      <label for="phone">Phone Number</label>
      <input type="text" name="phone" id="phone" class="form-control">
    </div>

    <div class="form-group">
      <label for="adults">Adults</label>
      <input type="number" name="adultsNo" id="adultsNo" class="form-control">
    </div>

    <div class="form-group">
      <label for="children">Children</label>
      <input type="number" name="children" id="children" class="form-control">
    </div>

    <div class="form-group">
      <label for="city">City</label>
      <select name="city" id="city"  style="width: 250px" class="form-control">
      <option selected disabled>Select</option>
      <option value="Brisbane">Brisbane</option>
      <option value="Vancouver">Vancouver</option>
      <option value="New_York_City">New York City</option>
      <option value="Berlin">Berlin</option>
      <option value="Cancun">Cancun</option>
      </select>
    </div>

    <div class="form-group">
      <label for="activity">Activity</label>
      <select name="activity" id="activity" style="width: 250px" class="form-control">
      <option selected disabled>Select</option>
      </select>
    </div>

    <div class="form-group">
      <label for="traveldate">Travel Date</label>
      <input type="date" name="traveldate" id="traveldate" style="width: 250px" class="form-control">
    </div>

    <div class="form-group">
    <button type="submit" form="reservationform" value="Submit" style="width: 100px">Submit</button><br>
    </div>

    <div class="form-group">
    <button type="reset" value="Reset" style="width: 100px" >Reset</button>

  </form>

  </div>
  </div>
  <script src="megatravel.js"></script>

  </body>
</html>

最佳答案

尝试改变:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">

到:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css">

可能是您使用的是错误的过时版本/链接

关于css - 导航栏未显示在网站的第二页上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55908464/

相关文章:

javascript - 通过 javascript 更改按钮删除线

php - HTML通过JSON输出,通过ajax激活

javascript - 弹出窗口中的 Bootstrap 4 输入字段

css - 使用 bootstrap 4 在移动设备中查看时如何隐藏文本链接

html - Bootstrap 4 : div with Equal height with color fill and gutter in between

html - 使用加法变换风格化兄弟元素

css - 我在 Dreamweaver 中使用 SpryTabbedPanels,我只需要更改菜单字体大小吗?

javascript - 隐藏div中的日历

javascript - 防止 Element.scrollIntoView() 函数滚动父元素,其中 Element 在 iframe 中

java - 无法在网络浏览器中运行小程序程序,但在小程序查看器中运行正常?