Base64 Inline Image use more than once

筅森魡賤 提交于 2019-12-11 14:15:52

问题


is it possible to use the Data of an Base64 encoded inline-image more than once? Or do I have to write the Data in every img statement?

Thanks in common


回答1:


You could use CSS to specify the content for the image

.myImage {
  content: url('data:image/gif;base64,R0lGODlhEAAQALMPAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD/AP//AAAA//8A/wD//////yH5BAEAAA8ALAAAAAAQABAAQAQ78EkJqp10LaB759sDVh4ZiqVVTqC3om6smVvcAmz74Zioz7zMRmfC/WTAGXI0Ws5gtc+HhXz2fJagJAIAOw==');
}
<img src="#" class="myImage" />    

But if you're looking to do something in pure HTML there isn't any way to reuse data URIs.



来源:https://stackoverflow.com/questions/29187840/base64-inline-image-use-more-than-once

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!