2017-04-24 94 views
-1

我的CSS圖像未顯示。在文件結構中一切都是相對的。CSS背景圖片未顯示

.header-container { 
 
    position: relative; 
 
    width: 100%; 
 
    min-height: auto; 
 
    -webkit-background-size: cover; 
 
    -moz-background-size: cover; 
 
    background-size: cover; 
 
    -o-background-size: cover; 
 
    background-position: center; 
 
    background-image: url('/images/header.jpg'); 
 
    text-align: center; 
 
    color: white; 
 
}
<div class="header-container"> 
 
    <div class="header-content"> 
 
     <div class="header-content-inner"> 
 
      <h1 id="homeHeading">Your Favorite Source of Free Bootstrap Themes</h1> 
 
      <hr> 
 
      <p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p> 
 
      <a href="#about" class="btn btn-primary btn-xl page-scroll">Find Out More</a> 
 
     </div> 
 
    </div> 
 
</div>

+0

「一切都相對明智是正確的,涉及文件結構」 - 你是如何證實這一點的? – Quentin

+0

正如你在這裏看到的,圖像顯示出來了:https://jsfiddle.net/zszf5hff/ – Vivick

+0

這些東西重寫它! –

回答

0

您正在使用/你的圖片路徑。刪除/之前images/header.jpg並再試一次。沒有/它對我來說工作得很好。 你必須爲圖像準備正確的路徑。

+0

我只是試過它仍然不工作! idk爲什麼我有其他的CSS,所以也許有什麼是騎在背景圖像? –

+0

有些事情正在發展,我將如何能夠找到答案? –

+0

你怎麼能測試「沒有/它適合我工作」? – grgarside