Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use a base64 embedded image multiple times

Tags:

html

base64

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,..."/>

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?

like image 736
steveo225 Avatar asked Aug 24 '11 13:08

steveo225


1 Answers

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

Then just add the class to the elements you want.

like image 79
alex Avatar answered Oct 23 '22 06:10

alex