您可以在下方找到导航栏和jumbotron div。我已经使用过bootstrap,但经过多次努力尝试纠正代码后,我找不到问题。
<body>
<div>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Ankur Chavda</a>
</div>
<div id="navbar" class="navbar-collapse navbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Home</a></li>
<li class=""><a href="#"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> About</a></li>
<li class=""><a href="#"><i class="fa fa-envelope-o"></i> Contact</a></li>
</ul>
</div>
</div>
</nav>
</div>
>Jumbotron
<div class="jumbotron"> //jumbotron
<div class="container">
<div class="row">
<p>hello</p>
</div>
</div>
</div>
</body>
答案 0 :(得分:0)
答案 1 :(得分:0)
我清理了你的代码,并在导航栏和jumbotron之间增加了空间。
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet"href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<div>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Ankur Chavda</a>
</div>
<div id="navbar" class="navbar-collapse navbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Home</a></li>
<li class=""><a href="#"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> About</a></li>
<li class=""><a href="#"><i class="fa fa-envelope-o"></i> Contact</a></li>
</ul>
</div>
</div>
</nav>
</div><br><br><br>
<!--Here <br> is used for giving space between the navigation bar and jumbotron-->
<!-- Jumbotron -->
<div class="container">
<div class="jumbotron">
<div class="row">
<p>hello</p>
</div>
</div>
</div>
</body>
</html>