• <tfoot id='yRrLn'></tfoot>

    • <bdo id='yRrLn'></bdo><ul id='yRrLn'></ul>
  • <i id='yRrLn'><tr id='yRrLn'><dt id='yRrLn'><q id='yRrLn'><span id='yRrLn'><b id='yRrLn'><form id='yRrLn'><ins id='yRrLn'></ins><ul id='yRrLn'></ul><sub id='yRrLn'></sub></form><legend id='yRrLn'></legend><bdo id='yRrLn'><pre id='yRrLn'><center id='yRrLn'></center></pre></bdo></b><th id='yRrLn'></th></span></q></dt></tr></i><div id='yRrLn'><tfoot id='yRrLn'></tfoot><dl id='yRrLn'><fieldset id='yRrLn'></fieldset></dl></div>

        <small id='yRrLn'></small><noframes id='yRrLn'>

        <legend id='yRrLn'><style id='yRrLn'><dir id='yRrLn'><q id='yRrLn'></q></dir></style></legend>
      1. 使用 &lt;a href=&quot;data; 是否安全?..."&gt;显示图像

        Is it safe to use lt;a href=quot;data; ...quot;gt; to display images?(使用 lt;a href=quot;data; 是否安全?...gt;显示图像?)
              <bdo id='4jyfy'></bdo><ul id='4jyfy'></ul>
              • <tfoot id='4jyfy'></tfoot>
                  <tbody id='4jyfy'></tbody>

                <small id='4jyfy'></small><noframes id='4jyfy'>

                <i id='4jyfy'><tr id='4jyfy'><dt id='4jyfy'><q id='4jyfy'><span id='4jyfy'><b id='4jyfy'><form id='4jyfy'><ins id='4jyfy'></ins><ul id='4jyfy'></ul><sub id='4jyfy'></sub></form><legend id='4jyfy'></legend><bdo id='4jyfy'><pre id='4jyfy'><center id='4jyfy'></center></pre></bdo></b><th id='4jyfy'></th></span></q></dt></tr></i><div id='4jyfy'><tfoot id='4jyfy'></tfoot><dl id='4jyfy'><fieldset id='4jyfy'></fieldset></dl></div>

                <legend id='4jyfy'><style id='4jyfy'><dir id='4jyfy'><q id='4jyfy'></q></dir></style></legend>

                • 本文介绍了使用 &lt;a href=&quot;data; 是否安全?..."&gt;显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I've learned that it's possible to embed an image in an HTML page like so, instead of linking to a separate image file:

                  <a href="data:image/png;base64,...(blah blah base64-encoded png goes here)..."
                    width="70" height="38" alt="image embedded using base64 encoding!"></a>
                  

                  Is this "safe", as in will all modern browsers be able to view the image, as long as I stick to common formats like PNG/JPG? Are there any downsides, other than base64-encoding the image increasing the image size by a bit?

                  Thanks.

                  解决方案

                  Yes, this is safe - all major browsers support the data URI scheme.

                  One downside is that if you use the same image a number of times in the page, it will be encoded several times vs downloaded once.

                  Another is the size limit imposed by some browsers (IE 8 only allows up to 32k).

                  You can also use this in CSS to mitigate the download issue.

                  这篇关于使用 &lt;a href=&quot;data; 是否安全?..."&gt;显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Plot data in website from multiple csv file(从多个 csv 文件中绘制网站中的数据)
                  Content Service for Google Apps Script returning HTML instead of JSON(返回 HTML 而不是 JSON 的 Google Apps 脚本的内容服务)
                  Requesting blob images and transforming to base64 with fetch API(使用 fetch API 请求 blob 图像并转换为 base64)
                  Javascript Confirm popup Yes, No button instead of OK and Cancel(Javascript 确认弹出窗口是,否按钮而不是确定和取消)
                  Opensource/free HTML5/CSS3/JavaScript IDE?(开源/免费 HTML5/CSS3/JavaScript IDE?)
                  jump to CSS selector in a css file from the HTML file in Vim using a single keystroke(使用单次击键从 Vim 中的 HTML 文件跳转到 CSS 文件中的 CSS 选择器)
                    <bdo id='Rx6YD'></bdo><ul id='Rx6YD'></ul>
                  • <small id='Rx6YD'></small><noframes id='Rx6YD'>

                    <i id='Rx6YD'><tr id='Rx6YD'><dt id='Rx6YD'><q id='Rx6YD'><span id='Rx6YD'><b id='Rx6YD'><form id='Rx6YD'><ins id='Rx6YD'></ins><ul id='Rx6YD'></ul><sub id='Rx6YD'></sub></form><legend id='Rx6YD'></legend><bdo id='Rx6YD'><pre id='Rx6YD'><center id='Rx6YD'></center></pre></bdo></b><th id='Rx6YD'></th></span></q></dt></tr></i><div id='Rx6YD'><tfoot id='Rx6YD'></tfoot><dl id='Rx6YD'><fieldset id='Rx6YD'></fieldset></dl></div>

                        <tbody id='Rx6YD'></tbody>

                        <tfoot id='Rx6YD'></tfoot>

                            <legend id='Rx6YD'><style id='Rx6YD'><dir id='Rx6YD'><q id='Rx6YD'></q></dir></style></legend>