2011-07-29 165 views
2

尝试缩放图像下使用的背景大小的CSS规则,但似乎与Firefox 3.5火狐忽略背景大小的CSS

CSS

.privatejoker { 
    background: aqua url("../styles/images/home-privatejoker.png") no-repeat 0 0; 
    background-size: 365px 341px; 
    height:341px; 
    margin: 0 auto; 
    display:block; 
    margin-top: -6px; 
    } 
+0

火狐的什么版本? – BoltClock

+0

在此处查看浏览器对背景大小的支持:http://www.quirksmode.org/css/background.html – sqwk

+3

https://developer.mozilla.org/en/CSS/background-size#Notes –

回答

5

background-size忽视加入到Firefox 3.6 ,但是需要-moz供应商前缀。

从版本4开始,不再需要它。如果你也想支持Firefox 3.6,除了普通属性外,还要包含供应商前缀。

Joseph为MDN上的further reading提供了一个很好的链接。

+0

感谢您解释Alex :) – Rob

0

尝试提供大小的百分比格式

background-size:100% 70%; 
100% is the width 
70% is the height