如何在电子邮件中将SVG嵌入到HTML中,以便在大多数/所有电子邮件浏览器中都可见? [英] How can I embed SVG into HTML in an email, so that it's visible in most/all email browsers?
问题描述
我想在SVG中生成图形,并通过电子邮件发送一个嵌入了这些图形的HTML页面(不存储在服务器上并显示链接的图像)。
I want to generate graphs in SVG, and email an HTML page with those graphs embedded in it (not stored on a server and shown with linked images).
我试过直接嵌入SVG,使用Object元素,序列化和URI编码SVG,并将整个字符串指定为div上的背景图像。没有什么似乎在Outlook 2013中显示。任何想法?
I've tried directly embedding the SVG, using the Object element, and serializing and URI encoding the SVG and specifying the whole string as a background image on a div. Nothing seems to display in Outlook 2013. Any ideas?
推荐答案
许多电子邮件客户端不支持SVG。我见过的最佳指南是风格广告系列 即可。
SVG is not supported in many email clients. The best guide I’ve seen is on Style Campaign. It’s a short read that I vouch for (Anna is super smart!).
TL; DR:各种技术都可以在iOS邮件客户端和(非常棒的)黑莓手机上运行。但Android,Outlook以及几乎所有的桌面电子邮件电子邮件SVG都不支持SVG,并且需要回退。
TL;DR: A variety of technique will work in iOS mail clients and (amazingly) Blackberry. But Android, Outlook, and pretty much every desktop webmail email SVG does not support SVG and requires a fallback.
这篇关于如何在电子邮件中将SVG嵌入到HTML中,以便在大多数/所有电子邮件浏览器中都可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!