How do I scale a stubborn SVG embedded with the <object> tag?

前端 未结 9 1311
眼角桃花
眼角桃花 2020-11-28 02:03

I have some SVG files that specifies width and height as well as viewbox like this:



        
9条回答
  •  迷失自我
    2020-11-28 02:18

    Let see. I had to refresh my memory on SVG, I haven't used it much these years.

    From what I found today, it seems that if you specify dimension of objects without units, they have a fixed size (in pixels, I think). Apparently, then, there is no way to resize them when you resize the SVG (it only change the viewport/canvas size).

    Unless, as pointed out, you specify the size of the SVG in percentage OR specify a viewBox (eg. viewBox="0 0 600 500").

    Now, if you have no way to change the exported SVG, you are out of luck, I fear. What library do you use?

提交回复
热议问题