Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does background-size:100% 100%; not work on this SVG?

Look at the example:

.container {
   background-image:url("http://svgshare.com/i/3cM.svg");
   background-position:center center;
   background-repeat:no-repeat;
   width:400px;
   height:200px;
   background-color:#eef;
   border-bottom:1px solid #000;
   background-size:100% 100%;
}
<div id="container1" class="container"></div>

Related question: Stretch a background image (SVG) to 100% width and 100% height?

like image 304
Blackbam Avatar asked Oct 27 '17 16:10

Blackbam


1 Answers

Open your .svg file and set

preserveAspectRatio="none"

within the SVG tag.

like image 171
holden Avatar answered Oct 16 '22 12:10

holden