Html - 直接在 html 中嵌入图像(老派风格)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2002147/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 01:45:29  来源:igfitidea点击:

Html - embed image directly in html (old school style)

htmlimageembed

提问by Stephane Grenier

I know you can embed images in html today with:

我知道你今天可以在 html 中嵌入图像:

<IMG SRC="data:image/gif;base64,RAAA...more data.....">

But back in the day, when Netscape was a browser to implement for, there was another way of doing this. I can't remember.

但在过去,当 Netscape 是一个要实现的浏览器时,还有另一种方法可以做到这一点。我不记得了。

Any suggestions would be appreciated.

任何建议,将不胜感激。

采纳答案by AlexV

I don't know any other way specific to Netscape (RIP) and a quick search showed me that "IMG SRC=data:" has been supported by Netscape already in 2003.

我不知道 Netscape (RIP) 特有的任何其他方式,快速搜索显示“IMG SRC=data:”已在 2003 年被 Netscape 支持。

I found out some IE specific tags that look like yours, but never used them (not sure it will help):

我发现了一些看起来像你的 IE 特定标签,但从未使用过它们(不确定它会有所帮助):

<img datasrc="bar" datafld="foo">

Some more info on embeded images in sources here (can help readers unfamiliar with this topic): http://www.websiteoptimization.com/speed/tweak/inline-images/

这里有更多关于嵌入图像的信息(可以帮助不熟悉这个主题的读者):http: //www.websiteoptimization.com/speed/tweak/inline-images/

Here is a way to use "IMG SRC=data:" under IE6: http://web.archive.org/web/20080702001125/http://ddzoom.net/jsimages/out.htm

这是在IE6下使用“IMG SRC=data:”的方法:http://web.archive.org/web/20080702001125/http: //ddzoom.net/jsimages/out.htm