使用一个base64内嵌图片多次 [英] Use a base64 embedded image multiple times

查看:197
本文介绍了使用一个base64内嵌图片多次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个HTML文档中一对夫妇的小图片,我想使便携,例如电子邮件时仍然有效。我用下面的,伟大的工程:

I have a couple small images in an HTML document that I want to make portable, e.g. still works when emailing. I use the following, which works great:

<img src="data:image/png;base64,..."/>

问题是,我想在文档中使用相同的图像很多次,但不想重复整个的base64数据串。我已经看到了邮件,其中的数据连接codeD单一的时间,但很多参考。这可能与HTML?

Problem is, I want to use the same image many times in the document, but don't want to repeat the entire base64 data string. I have seen in emails where the data is encoded a single time, but referenced many. Is this possible with HTML?

推荐答案

如果您可以使用CSS,你莫不是把它相反,作为一类。

If you can use CSS, you could place it there instead, as a class.

然后,只需将该类添加到您想要的元素。

Then just add the class to the elements you want.

这篇关于使用一个base64内嵌图片多次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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