如何将 SVG 嵌入到电子邮件的 HTML 中,以便在大多数/所有电子邮件浏览器中都可以看到它? [英] How can I embed SVG into HTML in an email, so that it's visible in most/all email browsers?

查看:71
本文介绍了如何将 SVG 嵌入到电子邮件的 HTML 中,以便在大多数/所有电子邮件浏览器中都可以看到它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 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 元素,并对 SVG 进行序列化和 URI 编码,并将整个字符串指定为 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 在许多电子邮件客户端中不受支持.我见过的最好的指南是关于 Style Campaign.我保证这是一个简短的阅读(安娜超级聪明!).

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,因此需要回退.

TL;DR: A variety of techniques will work in iOS mail clients and (amazingly) Blackberry. But Android, Outlook, and pretty much every other desktop and webmail client does not support SVG and requires a fallback.

这篇关于如何将 SVG 嵌入到电子邮件的 HTML 中,以便在大多数/所有电子邮件浏览器中都可以看到它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆