如何在HTML中显示的base64图像? [英] How to display base64 images in HTML?

查看:672
本文介绍了如何在HTML中显示的base64图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遇到问题显示的base64图像内联。

有人能指出我在正确的方向?

 <!DOCTYPE HTML>
   < HTML和GT;
    < HEAD>
        <标题>显示图片< /标题>
    < /头>
     <身体GT;
     < IMG风格=显示:块;宽度:100像素,高度:100像素;' ID ='base64image
       SRC =数据:图像/ JPEG; BASE64,LzlqLzRBQ ...< - 数据的base64 - >' />
   < /身体GT;


解决方案

我怀疑是当然的base64实际数据,否则对我来说很好。请参见这个小提琴有类似的计划正在发挥作用。您可以尝试指定字符集。

您可以尝试本德的base64 codeR 来看看你的base64数据正确与否。

Having trouble displaying a base64 image inline.

Can someone point me in the right direction?

  <!DOCTYPE html>
   <html>
    <head>
        <title>Display Image</title>


    </head>
     <body>
     <img style='display:block; width:100px;height:100px;' id='base64image'                 
       src='data:image/jpeg;base64, LzlqLzRBQ...<!-- base64 data -->' />
   </body>

解决方案

My suspect is of course actual base64 data, otherwise it looks good to me. See this fiddle where similar scheme is working. You may try specifying char set.

You can try this base64 decoder to see if your base64 data is correct or not.

这篇关于如何在HTML中显示的base64图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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