Why doesn't -moz-background-size:cover work in Firefox?

后端 未结 1 699
别跟我提以往
别跟我提以往 2020-12-12 01:55

I\'m coding a site that contains 3 wide images which need to have 100% width at all times. I\'m using media queries and I would rather not have to make 3+ copies of each ima

相关标签:
1条回答
  • 2020-12-12 02:32

    You need to add background-size after the prefixed versions:

    #artwork1 {
        width: 1500px;
        height:500px;
        background-image: url(../img/menupic_1.png);
        background-repeat:no-repeat;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
    }
    
    • http://jsfiddle.net/RtPEA/5/

    -moz-background-size was only supported in Firefox 3.6, and the other prefixed versions aren't guaranteed to stick around.

    0 讨论(0)
提交回复
热议问题