微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css – Firefox / Opera是否处理定位/多个背景图像?

在Firefox / Opera中显示特定背景图像的问题,所有其他浏览器都在玩球(显然IE除外,我不得不妥协).

目前,Opera不允许多个背景图像:

background-image: url('/images/h2_default_bg.png'),url('/images/dashed_bg_default.gif');
background-repeat: no-repeat,repeat-x;
background-position: top left,bottom left;

当背景图像以像素为单位时,Firefox和Opera都很尴尬:

background: url('/assets/images/dashed_bg.gif') bottom 2px repeat-x;

这些问题都有简单的解决方法吗?

解决方法

仅从 Firefox 3.6Opera 10.5开始支持多个背景.您正在测试的版本是? Chrome和Safari已经支持它们,我认为你的意思是“所有其他浏览器……除了显然IE”

至于你的第二个问题,the spec says this about the background-position syntax

If two values are given and at least one value is not a keyword,then the first value represents the horizontal position (or offset) and the second represents the vertical position (or offset).

所以你给了他们错误的顺序.改为2px底部.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。