Css背景图像问题

时间:2015-11-02 14:42:23

标签: html css background-image

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

  

解析' background-image'的值时出错。声明被撤销。

代码(HTML):

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

码(CSS):

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

2 个答案:

答案 0 :(得分:1)

试试这个:

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

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

之后结束

答案 1 :(得分:1)

使用'use strict'; var mongoose = require('mongoose'), Schema = mongoose.Schema; var dwollaSchema = new Schema({ user_id:{ type: String}, username: { type: String }, dwolla_id: { type: String }, transactions: [{ Amount: String, DestinationId:String, DestinationName:String, SourceId:String, SourceName:String, status:String }], modified: { type: Date, default: Date.now } }); module.exports = mongoose.model('Dwolla',dwollaSchema); 更改display: inline;,同时添加背景属性:

display: inline-block;