html - How can I resize svg using CSS? -


i've found related question here: how can resize svg?

i resize arrow made in swg using css. in related question objective achieved through html directive (viewbox="0 0 32 32")

do have suggestion?

#div_1 {      float: left;      font-family: 'pt sans narrow';      font-size: 13px;      height: 33px;      overflow-wrap: break-word;      padding-right: 20px;      padding-top: 8px;      text-align: center;      width: 50px;      word-wrap: break-word;      perspective-origin: 35px 20.5px;      transform-origin: 35px 20.5px;      font: normal normal normal normal 13px/normal 'pt sans narrow';      padding: 8px 20px 0px 0px;  }/*#div_1*/    #svg_2 {      font-family: 'pt sans narrow';      font-size: 13px;      height: 29px;      overflow-wrap: break-word;      overflow-x: hidden;      overflow-y: hidden;      text-align: center;      width: 50px;      word-wrap: break-word;      perspective-origin: 25px 14.5px;      transform-origin: 25px 14.5px;      font: normal normal normal normal 13px/normal 'pt sans narrow';      overflow: hidden;  }/*#svg_2*/    #path_3 {      font-family: 'pt sans narrow';      font-size: 13px;      overflow-wrap: break-word;      text-align: center;      word-wrap: break-word;      fill: rgb(25, 94, 2);      font: normal normal normal normal 13px/normal 'pt sans narrow';  }/*#path_3*/
<div class="igc-textual-icon" id="div_1"><svg data-id="" height="29" width="50" version="1.1" xmlns="http://www.w3.org/2000/svg" id="svg_2">      <path class="igc-table-scaledpath" fill="#195e02" d="m50,25c49.99999999999999,25.84,49.69333333333333,26.573333333333334,49.08,27.2c48.46666666666666,27.826666666666664,47.73333333333333,28.133333333333333,46.879999999999995,28.12c46.879999999999995,28.12,3.1399999999999935,28.12,3.1399999999999935,28.12c2.2999999999999936,28.119999999999997,1.56666666666666,27.813333333333333,0.9399999999999933,27.2c0.31333333333332647,26.586666666666662,0.006666666666659825,25.853333333333328,0.019999999999993245,25c0.033333333333326665,24.14666666666667,0.3399999999999933,23.413333333333334,0.9399999999999933,22.8c0.9399999999999933,22.8,22.819999999999993,0.9200000000000017,22.819999999999993,0.9200000000000017c23.433333333333326,0.3066666666666683,24.166666666666657,1.6653345369377348e-15,25.019999999999992,1.6653345369377348e-15c25.87333333333332,1.6653345369377348e-15,26.606666666666655,0.3066666666666683,27.21999999999999,0.9200000000000017c27.21999999999999,0.9200000000000017,49.099999999999994,22.8,49.099999999999994,22.8c49.713333333333324,23.413333333333334,50.019999999999996,24.14666666666667,50.019999999999996,25c50.019999999999996,25,50,25,50,25" id="path_3"></path>  </svg></div>

add code svg in html preserveaspectratio="xminymin meet" remove width , height, , after can resize changing width , height of parent div

here example. can change , height of parent div in css,

example

html part

<div class="igc-textual-icon" id="div_1"><svg data-id="" viewbox="0 0 56 56" preserveaspectratio="xminymin meet" version="1.1" xmlns="http://www.w3.org/2000/svg" id="svg_2">     <path class="igc-table-scaledpath" fill="#195e02" d="m50,25c49.99999999999999,25.84,49.69333333333333,26.573333333333334,49.08,27.2c48.46666666666666,27.826666666666664,47.73333333333333,28.133333333333333,46.879999999999995,28.12c46.879999999999995,28.12,3.1399999999999935,28.12,3.1399999999999935,28.12c2.2999999999999936,28.119999999999997,1.56666666666666,27.813333333333333,0.9399999999999933,27.2c0.31333333333332647,26.586666666666662,0.006666666666659825,25.853333333333328,0.019999999999993245,25c0.033333333333326665,24.14666666666667,0.3399999999999933,23.413333333333334,0.9399999999999933,22.8c0.9399999999999933,22.8,22.819999999999993,0.9200000000000017,22.819999999999993,0.9200000000000017c23.433333333333326,0.3066666666666683,24.166666666666657,1.6653345369377348e-15,25.019999999999992,1.6653345369377348e-15c25.87333333333332,1.6653345369377348e-15,26.606666666666655,0.3066666666666683,27.21999999999999,0.9200000000000017c27.21999999999999,0.9200000000000017,49.099999999999994,22.8,49.099999999999994,22.8c49.713333333333324,23.413333333333334,50.019999999999996,24.14666666666667,50.019999999999996,25c50.019999999999996,25,50,25,50,25" id="path_3"></path> </svg></div> 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -