背景图像没有显示在页面上

时间:2014-10-31 00:06:31

标签: css background-image

我的背景图片没有显示。这是CSS:

.banner {
    height: 25em;
    width: 100%;
    background: #F0F3F7 url("images/Dog_02.jpg");
    background-size: cover; 
}

这是HTML:

<article class = "section group">
    <section class = "banner col span_8_of_8">

背景颜色确实显示但图像没有显示。我已经检查了Google Chrome中的开发者工具。它没有列出错误。

1 个答案:

答案 0 :(得分:1)

enter image description here我试试这个演示工作请尝试,你的问题没有为url

background image提供正确的路径
.banner {
        height: 25em;
        width: 100%;
        background:url("images/Desert.jpg");
        background-size: cover; 
    }

//你的身体部位

<article class = "section group">
    <section class = "banner col span_8_of_8">
    </section>
</article>
相关问题