Css 背景图像问题

Css background-image issue

我正在尝试将此图像设置为:http://www.flaticon.com/free-icon/linkedin-logo_34405#term=linkedin&page=1&position=1 作为我的背景图像,但它不起作用...

Error in parsing value for 'background-image'. Declaration dropped.

代码(HTML):

<div class="linkedin"></div>

代码(CSS):

.linkedin {
    display: inline;
    background-image: url(../images/Linkedin(Idle).png);
    width: 16px;
    height: 16px;
}

试试这个:

.linkedin {
    display: inline;
    background-image: url('../images/Linkedin(Idle).png');
    width: 16px;
    height: 16px;
}

中间的括号干扰了解析器,假设图像在 Idle)

之后结束

display: inline;更改为display: inline-block;,同时添加背景属性:

.linkedin {
    display: inline-block;
    background-image: url('../images/Linkedin(Idle).png');
    background-repeat: no-repeat;
    background-position: 0 0;
    width: 16px;
    height: 16px;
}