Stretch svg background without keeping aspect ratio

后端 未结 3 1405
花落未央
花落未央 2021-01-26 06:30

I want to use an svg image as background-image, I want to show the entire image (no crop) and stretch the image to 100% height and width of the container div without

3条回答
  •  别那么骄傲
    2021-01-26 06:58

    .sample {
       height:500px;
       width:500px;
       background-image: url('sample.svg');
       background-size:cover;
       background-position:center center;
    }
    
    
    

    Just try it. I hope this will help you

提交回复
热议问题