2017-04-24 93 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