我已经在目标网页上使用了该导航栏,并且我希望它在第二页上也看起来相同,但是没有显示出来。我不确定自己在做什么错,因为我只是从首页复制/粘贴。
这可能只是缺少一些小东西,但是我一直盯着它看了一段时间,似乎无法弄清楚。
这是第二页上的代码,不会显示在该页面上。
<!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>
答案 0 :(得分:0)
尝试更改:
<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">
可能是您使用的版本/链接过时而有错误