html - 在 img 标签中使用 .ico

标签 html image firefox ico

当在 img 标签中使用 ico 文件作为 src 时,我在 Firefox 中遇到了下一个奇怪的行为。 当它在 Firefox(最新版本)中打开时,尽管 ico 原始格式为 128x128,但它具有 16x16 格式。 在其他浏览器(Chrome、IE)中一切正常。 只需在 Chrome 和 Firefox 中打开 elephant-128x128.ico,您就会看到不同之处。

<img height='128' src="http://icons.iconseeker.com/ico/cloth-dolls-icons/elephant-128x128.ico">


https://jsfiddle.net/qwx2sxzg/1/ 

或者 http://icons.iconseeker.com/ico/cloth-dolls-icons/elephant-128x128.ico 有人知道如何解决这个问题吗?

最佳答案

最好的办法是将 ico 文件转换为另一种格式,因为它不兼容所有浏览器。

Image Format Support For Web Browsers

没有其他解决方法。

关于html - 在 img 标签中使用 .ico,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30932591/

相关文章:

Android:我的应用程序保存的图像不会显示在图库中 - 即使重新启动后也是如此

javascript - 不要在 Blogger 中缓存图像

javascript - SteemJS 无法在 Firefox/IE 中运行

css - 固定 div 中的图像 - 有趣的 Firefox 行为

html - 如何在CSS中将表格中的不同列设置为不同的宽度?

html - 侧边栏下方显示的页面内容

javascript - 字符串过滤。需要去掉&lt;style&gt;标签及其内容,只保留<body>中的内容

c# - 如何在不降低质量的情况下调整图像大小

jquery - 使用 jquery 获取左边距在 Firefox 中不起作用

javascript - 让第一个 child 打开 Accordion