我在這裏讀到另一個答案並修復它(所以我想),但它仍然不會出現。我知道圖像是background.jpg,它在img文件夾中。我真的很困惑,爲什麼這不起作用。它可能是引導它搞砸了嗎?我假設沒有,因爲我的自定義CSS是在引導CSS後。爲什麼我的背景圖片不顯示?
.main-section {
background-image: url(../img/background.jpg);
}
<div class="container-fluid">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">BFG</a>
</div>
<div class="navbar-header">
<a class="navbar-brand" href="#"><i class="fa fa-heart" aria-hidden="true"></i></a>
</div>
<ul class=" nav navbar-nav">
<li><a href="#">Hours</a></li>
<li><a href="#">Gifts</a></li>
<li><a href="#">Flowers</a></li>
<li><a href="#">Balloons</a></li>
</ul>
</div>
</nav>
</div>
<div class="container-fluid">
<div class="jumbotron main-section">
<div class="row">
<div class="col-md-12 text-center">
<h1>Balloons Flowers and Gifts</h1>
<h3>The perfect way to brighten someone's day, and make them smile!</h3>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3 text-center">
<a href="#"><h2>Balloons</h2></a>
</div>
<div class="col-md-3 text-center">
<a href="#"><h2>Flowers</h2></a>
</div>
<div class="col-md-3 text-center">
<a href="#"><h2>Gifts</h2></a>
</div>
<div class="col-md-3 text-center">
<a href="#"><h2>Hours</h2></a>
</div>
</div>
你可以檢查控制檯,看看背景圖像是否沒有拋出任何錯誤,如文件未找到? –
@praveenKumar沒有錯誤。 –