CSS - Background-size: cover

0 votes
185 views
added Feb 8, 2019 in CSS by LC Marshal Captain (25,790 points)
edited Apr 4, 2019 by LC Marshal
$dkn-cover: 'img.jpg';
.background-size {
    // no-repeat comes first
    background: url($dkn-cover) no-repeat fixed;
    
    // followed by cover
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...