Search code examples
htmlcssgoogle-chromebackground-image

background-image doesn't work with Chromes


I have a background-image which appears well on Firefox but does not appear on Google Chrome at all. I don't understand ... Thank you very much.

edit : I see that I am told that the answer is already elsewhere but no. I don't have add block so it's not the same problem. Thank you anyway.

CSS :

    #section2{
        background: url(../images/references.png) no-repeat center center fixed; 
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
        position:relative;
    }

HTML :

<div id="section2">

</div>

Solution

  • use the background-image: property

    #section2{
            background-image: url(../images/references.png); 
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;
            position:relative;
        }