在IE中将图像嵌入单个html文件中

时间:2021-12-06 22:47:22

What is the best way to embed images in a single html file in IE?, i don't want a round trip request to a PHP file to decode the base64 data.

在IE中的单个html文件中嵌入图像的最佳方法是什么?我不希望对PHP文件进行往返请求来解码base64数据。

I read about MHTML, is that the only way?

我读过关于MHTML的,那是唯一的方法吗?

if yes, how can I resolve the style "background-image: url(images/top.png);"?

如果是,我该如何解析样式“background-image:url(images / top.png);”?

Regards, Manoj

1 个解决方案

#1


Take a look at Data URI Scheme

看看数据URI方案

****edit****

The above will not work in IE 6-7. MHTML is supported only by IE and you can view examples of how to implement here: MTHML text messages. However, I would recommend against this as it can get very messy and its not widely supported.

以上内容在IE 6-7中不起作用。 MHTML仅受IE支持,您可以在此处查看如何实现的示例:MTHML文本消息。但是,我建议不要这样做,因为它可能会变得非常混乱并且没有得到广泛的支持。

You could think about using CSS sprites to combine multiple small images into one. Techniques about how to do this are scattered all round the net. Here is an excellent guide: CSS Sprites: Image Slicing’s Kiss of Death

您可以考虑使用CSS sprite将多个小图像合并为一个。关于如何做到这一点的技术遍布网络。这是一个很好的指南:CSS Sprites:图像切片的死亡之吻

#1


Take a look at Data URI Scheme

看看数据URI方案

****edit****

The above will not work in IE 6-7. MHTML is supported only by IE and you can view examples of how to implement here: MTHML text messages. However, I would recommend against this as it can get very messy and its not widely supported.

以上内容在IE 6-7中不起作用。 MHTML仅受IE支持,您可以在此处查看如何实现的示例:MTHML文本消息。但是,我建议不要这样做,因为它可能会变得非常混乱并且没有得到广泛的支持。

You could think about using CSS sprites to combine multiple small images into one. Techniques about how to do this are scattered all round the net. Here is an excellent guide: CSS Sprites: Image Slicing’s Kiss of Death

您可以考虑使用CSS sprite将多个小图像合并为一个。关于如何做到这一点的技术遍布网络。这是一个很好的指南:CSS Sprites:图像切片的死亡之吻