我的导航栏完全正常,直到我一直向下滚动到页面底部。此时,我无法点击导航栏中的任何内容,我的jumbotron上的文字与Navbar重叠。
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/Users/Pat/Downloads/bootstrap-3.3.2-dist/css/bootstrap.css">
<link rel="stylesheet" href="Website_Layout.css">
<title>Home</title>
</head>
<body>
<div class="nav">
<div class="container-fluid">
<ul class="nav nav-pills">
<li><a href="Website.html">Home</a></li>
<li><a href="Projects.html">Projects</a></li>
<li><a href="Team.html">Team</a></li>
<li><a href="Contact.html">Contact</a></li>
</ul>
</div>
</div>
<div class="jumbotron">
<div class="container-fluid">
<h1>hi</h1>
<p>hi</p>
</div>
</div>
<div class="fuel">
<div class="container-fluid">
<h1>hi</h1>
<p>hi</p>
</div>
</div>
<div class="learn-more">
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
<h2>Development</h2>
<p>hi</p>
</div>
<div class="col-md-6">
<h2>hi</h2>
<p>hi</p>
</div>
</div>
</div>
</div>
<div class="nav2">
<div class="container-fluid">
<div class="row">
<div class="col-md-3">
<h1>hi</h1>
<p>hi</p>
<p>hi</p>
</div>
<div class="col-md-3">
<h2>hi</h2>
<ul>
<li><a href="Projects.html">Projects</a></li>
<li><a href="Team.html">Team</a></li>
<li><a href="Contact.html">Contact</a></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
这是我的css。
.nav {
width: 100%;
float: top;
position: fixed;
margin: 0 0 1em 0;
padding: 0;
background-color: black;
height: 60px;
}
.nav ul {
list-style: none;
width: 100%;
margin: 0;
padding: 0;
text-align: center;
}
.nav li a {
display: block;
padding: 20px 20px;
color: white;
font-size: 16px;
text-transform: uppercase;
}
.nav li a:hover {
color: #FF6600;
background-color: white;
height: 60px;
}
.jumbotron {
background-image: url("/Users/Pat/Documents/Safron_Mountain.jpeg");
height: 880px;
background-repeat: no-repeat;
background-size: cover;
margin-bottom: 0;
}
.jumbotron h1 {
font-size: 64px;
text-align: center;
color: #FF7F50;
text-shadow: -1.2px 0 black, 0 1.2px black, 1.2px 0 black, 0 -1.2px black;
font-weight: bold;
font-family: 'Shift',sans-serif;
padding-top: 15px;
padding-bottom: 20px;
}
.jumbotron p {
font-size: 26px;
font-weight: bold;
text-align: center;
}
.fuel {
height: 800px;
background-color: #FF7F50;
}
.fuel h1 {
text-align: center;
font-size: 68px;
padding-top: 200px;
padding-bottom: 50px;
color: white;
text-shadow: .3px .3px 0 #CCC, .6px .6px 0 #CCC, .9px .9px 0 #444, 1.2px 1.2px 0 #444, 1.5px 1.5px 0 #444, 1.8px 1.8px 0 #444;
}
.fuel p {
text-align: center;
font-size: 36px;
padding-left: 200px;
padding-right: 200px;
color: white;
}
.learn-more {
height: 800px;
}
.learn-more h2 {
text-align: center;
color: black;
font-size: 60px;
padding-top: 225px;
}
.learn-more p {
text-align: center;
color: black;
font-size: 32px;
padding-left: 50px;
padding-right: 50px;
}
.nav2 {
height: 150px;
background-image: url("/Users/Pat/Downloads/footer_lodyas/footer_lodyas.png");
}
.nav2 h1 {
font-size: 18px;
padding-bottom: 0px;
font-weight: bold;
color: white;
}
.nav2 p {
color: white;
}
.nav2 ul {
list-style: none;
margin: 0;
padding: 0;
}
.nav2 a {
color: white;
font-size: 14px;
}
.nav2 li a {
display: block;
padding: 5px 0px;
color: white;
}
.nav2 h2 {
font-size: 18px;
font-weight: bold;
color: white;
}
感谢您的帮助!
答案 0 :(得分:0)
尝试将其放在 CSS
中的.nav上.nav {
z-index: 100;
}