首页 > 开发 > CSS > 正文

IE8背景background: url不显示图片?

2017-09-12 09:39:22  来源: 网友分享

在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。

解决方案

rgba 是 CSS3 的东东,IE8 不支持。
试试把 rgba 去掉看看。