简体   繁体   中英

Iphone wont display an svg image in an image tag

I am trying to get an svg in an image format to display on an iphone by using the img tag. It's fine across all modern browsers and resizes ok in the browser when I shrink the browser size down to a mobile view.

Problem is that it doesn't display on an iphone. I have tried using the embed tag and the image did display but would not pick up the css for responsive resizing.

here's the two ways I tried.

<img src="img/bg1.svg" />

<embed src="img/bg1.svg" type="image/svg+xml" />

I built and saved the image in illustrator and saved it using the svg tiny 1.1 setting that is says is for mobile devices.

Any ideas as to why why this doesn't work? Or what is the best way to display an svg for all mobile devices?

我相信您可以使用链接到SVG文件的<iframe>嵌入图像。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM