firefox ignores background-size css
Trying to scale an image down using the background-s开发者_C百科ize CSS rule but seems to be ignored with Firefox 3.5
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;
}
background-size
was added to Firefox 3.6, however the -moz
vendor prefix was required.
Since version 4, it is no longer required. If you want to support Firefox 3.6 too, include the vendor prefix in addition to the normal property.
Joseph provides a good link for further reading at MDN.
background-size
will only work in FF4 + see https://developer.mozilla.org/en/CSS/background-size for earlier FF version workarounds.
Try providing the sizes in the percentage format
background-size:100% 70%;
100% is the width
70% is the height
精彩评论