背景图像不显示与CSS

时间:2015-04-19 03:21:43

标签: html css

我想设置背景图片,但它不起作用。 我不知道问题是什么,但它只是不起作用请帮助我。

html代码是:

<div class="main">
    <div class="header clearfix">
<div class="container">
    <div class="left-header">


        <a href="" title="Home" class="ann"><div class="logo"></div></a>
        <div class="fb-like" data-href="https://www.facebook.com/pages" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false"></div>
    </div>

  </div>
</div>

我的css是:

.logo{
background: url("img/logo.png") no-repeat center center; 
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 201px;
margin-left: 10px;
height: 76px;
margin-top: 19px;
transition:all .3s;
-webkit-transition:all .3s;
-moz-transition:all .3s;
-ms-transition:all .3s;
-o-transition:all .3s;
}

我的图像尺寸是231 * 86px希望你能找到答案然后发布

1 个答案:

答案 0 :(得分:1)

只需在图片中找到http://之前添加http://img/logo.png,就像{{1}}一样,它就会开始工作。