我是bootstrap的初學者,我一直在嘗試使用它來爲我的網站創建主頁。我現在面臨的問題是這樣的:Bootstrap:與jumbotron重疊的div
三個圖像重疊的超大屏幕,我想不通爲什麼。以下是HTML代碼:
<!--navigation bar-->
<div class="navbar-wrapper">
<nav class="navbar navbar-inverse navbar-static-top">
<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="logo" href="#"><img src="C:\Users\Mickey.Utopia\Documents\EdHoc\temp-logo.jpg" height= "50" width = "80"></a>
</div>
<div class="navbar-collapse collapse navbar-right">
<ul class="nav navbar-nav">
<!--
<li class="active"><a href="#">Home</a></li>
-->
<li class = "animate"><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href = "C:\Users\Mickey.Utopia\Documents\EdHoc\Sign_in.htm">Sign In</a></li>
<li><a href = "#">Sign Up</a></li>
</ul>
</div>
</div>
</nav>
</div>
<div class='jumbotron' >
<div class="container">
<div class="row">
<div class="col-xs-12 col-lg-12 col-sm-12" >
<h1 id="jumb">Welcome to EdHoc. <br>Discover the best places to learn and collaborate with friends to make learning easier.</h1>
</div>
<div class="row">
<div class="col-xs-8 col-lg-8 col-sm-8" id="search">
<!--Search Bar here-->
<input type="text" class="form-control" placeholder="Search by location, institute, discipline" id="srcb">
<!--Button-->
</div>
<div class="col-xs-4 col-lg-4 col-sm-4" id="button">
<a href="" class="btn btn-default">Go</a>
</div>
</div>
</div>
</div>
</div>
<hr>
<div class="container marketing">
<!-- Three columns of text below the jumbotron -->
<div class="row">
<div class="col-sm-8 col-xs-12 col-lg-4">
<img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
<h2>Heading</h2>
<p>Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
<h2>Heading</h2>
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div><!-- /.col-lg-4 -->
</div><!-- /.row -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="\bootstrap-3.3.5-dist\bootstrap-3.3.5-dist\js\bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
相關的CSS(除了引導文件):
.navbar {
background-color: transparent;
border: none;
}
.jumbotron {
height: 400px;
background-image: url(../images/woman.jpg);
background-size: cover;
border: none;
width: 100%;
position: absolute;
top:0;
z-index: -100;
}
#jumb {
color: white;
font-size: 20px;
}
我該如何解決這個問題?
你本地開發,或者你可以把鏈接發給站點着中的jsfiddle等複製,可以採取在檢查快看? – AdamJeffers
請不要在這裏要求緊急回覆 - 關於Stack Overflow的問題以及網上的任何地方都由志願者回答,我們認爲所有問題同等重要。 – halfer
打開檢查器,然後右鍵單擊灰色圓圈並選擇檢查元素。它應該突出顯示html中的元素,並從那裏排除故障。可能是這個? –