[英]Css background-image issue
I am trying to set this image: http://www.flaticon.com/free-icon/linkedin-logo_34405#term=linkedin&page=1&position=1 as my background image, but it doesn't work... 我正在尝试将此图像设置为: http : //www.flaticon.com/free-icon/linkedin-logo_34405#term=linkedin&page=1&position=1作为我的背景图像,但是它不起作用...
Error in parsing value for 'background-image'.
解析“背景图像”的值时出错。 Declaration dropped.
宣言掉了。
Code(HTML): 代码(HTML):
<div class="linkedin"></div>
Code(CSS): 代码(CSS):
.linkedin {
display: inline;
background-image: url(../images/Linkedin(Idle).png);
width: 16px;
height: 16px;
}
Try this: 尝试这个:
.linkedin {
display: inline;
background-image: url('../images/Linkedin(Idle).png');
width: 16px;
height: 16px;
}
The parenthesis in the middle are interfering with the parser, and it's assuming the image ends right after Idle)
中间的括号干扰了解析器,并假设图像在
Idle)
之后立即结束Idle)
Change display: inline;
更改
display: inline;
with display: inline-block;
带
display: inline-block;
, also add background properties: ,还添加背景属性:
.linkedin {
display: inline-block;
background-image: url('../images/Linkedin(Idle).png');
background-repeat: no-repeat;
background-position: 0 0;
width: 16px;
height: 16px;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.