Resizing container while obtaining the same SVG percentage width

时间:2018-10-02 09:16:10

标签: html css svg

I'm trying to obtain the same percent of the filled container with an SVG when resizing container. enter image description here

as you can see when I resize the container of my SVG, it doesn't update, the width of SVG remains the same, not 80% of the container.

<svg width="80%" height="100%" preserveAspectRatio="xMidYMid meet" viewBox="0 0 100% 100%">
   <defs>
     <clipPath id="progress-clipping-mask">
         <rect width="100%" height="100%"/>
     </clipPath>
   </defs>
</svg>

Is there a way to remain 80% of the container even if it changes its width?

0 个答案:

没有答案