我有这个 CSS 代码:
#type_box {
width:30px;
height:30px;
margin-right:5px;
border-radius:20px;
}
.box_okay {
background:url(/images/tick.png) no-repeat;
}
.box_none {
background:#000000;
}
.box_Warning {
background:url(/images/tick.png) no-repeat;
}
.box_Error {
background:url(/images/cross.png) no-repeat;
}
.box_Maintenance {
background:url(/images/spanner.png) no-repeat;
}
这个HTML:
<div id="type_box" class="box_okay"></div>
<div id="type_box" class="box_Warning"></div>
<div id="type_box" class="box_Error"></div>
<div id="type_box" class="box_Maintenance"></div>
但图像没有显示 - 这是一个例子:http: //jsfiddle.net/42usL/