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

前端 未结 9 1344
眼角桃花
眼角桃花 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:26

    I encountered a problem where iOS on an iPad would not correctly resize SVG images in a tag.

    The CSS style would increase or decrease size of the container, but the image inside of it would not be modified (on iPad, iOS 7).

    The SVG images were exported from Adobe Illustrator, and the solution turned out to be replacing the width and height in this:

    
    

    with:

    width="100%" height="100%"
    

    I needed to use the tag because the tag does not currently support embedding bitmapped images in SVG's.

    提交回复
    热议问题