在Jumbotron中创建背景图像

时间:2015-05-27 22:44:40

标签: html css twitter-bootstrap

我需要在jumbotron bootstrap模板中创建背景图像,但它没有显示。我在CSS中编写的代码是:

HTML:

<div class="jumbotron"> 
      <div class="container">
        <p>The RobFran Restaurant opened its doors in May 2010. During this short time, this restaurant has built an 
           excellent reputation for its food, services and location...</p>
        <p><a class="btn btn-primary btn-lg" href="about.php" role="button">Read more &raquo;</a></p>
      </div>
    </div>

的CSS:

.jumbotron {
    background-image: url("view.jpg");
}

我做错了什么? 谢谢!

1 个答案:

答案 0 :(得分:1)

检查以确保您的文件路径(view.jpg)是正确的。

将样式表更改为

.jumbotron{
   background: url('view.jpg');
}