在IE8下,background: url设置背景图片不显示,代码:
<style>
.up{
background: url("/static/images/sprite-3.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
float: left;
height: 11px;
margin: 0px 5px 0 2px;
width: 9px;
background-position: 0 -16px;
z-index:10000;
}
.down{
background: url("/static/images/sprite-3.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
float: left;
height: 11px;
margin: 0px 5px 0 2px;
width: 9px;
background-position:-14px;
z-index:10000;
}
</style>
图片的路径确定是没有问题的,在IE8调试下,“background: url("/static/images/sprite-3.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
” 这段莫名的消失了,在火狐和google浏览器下都ok。
ie8 background: url 后边一般只接受两个参数
我在原生的XP系统IE8下测试没问题
你调用一下开发人员工具查看是否被遮挡,路径是否有问题或者大小是否有问题
还有试试把url的双引号改成单引号,或者直接去掉
再或者把HTML首行改成
<!DOCTYPE HTML>
<html lang="zh-CN">
某些极端的情况下它们会影响渲染效果
我只能提供我所能想到的可能有问题的地方了
rgba 是 CSS3 的东东,IE8 不支持。
试试把 rgba 去掉看看。