使用img src加载图像会在Mozilla / Chrome中产生不同的大小

[英]loading image using img src results in different size in Mozilla/Chrome


I am not an UI expert. For one of the requirement to show the reload icon, I downloaded the 128x128 pixel reload icon from the link - https://www.iconfinder.com/icons/28464/recycle_refresh_reload_sync_icon

我不是UI专家。对于显示重新加载图标的要求之一,我从链接下载了128x128像素重新加载图标 - https://www.iconfinder.com/icons/28464/recycle_refresh_reload_sync_icon

and used in my html page. Actually this was designed for a catcha page.

并在我的html页面中使用。实际上这是为catcha页面设计的。

<body>
<img src="reload.ico" />
</body>

When opened in Firefox, this was shown as a small image, but when opened in Chrome, it is relatively large. What is the reason behind this?

在Firefox中打开时,这显示为一个小图像,但在Chrome中打开时,它相对较大。这背后的原因是什么?

I agree that after changing the code to ,

我同意在更改代码后,

<body>
<img src="reload.ico" width="24px" height="24px" />
</body>

both the browsers are showing the same size. But i am interested to know why it was not in the first case.

两个浏览器都显示相同的大小。但我很想知道为什么它不是第一种情况。

edit: Actually I accidentally downloaded the 128x128. But then i am surprised to see this difference.

编辑:其实我不小心下载了128x128。但是,我很惊讶地发现这种差异。

1 个解决方案

#1


1  

The .ico files are only supported for the favicon.

.ico文件仅支持favicon。

Prefer the .png files for transparent images/icons.

首选.png文件以获取透明图像/图标。

You can see a list of supported formats per browser at Comparison of web browsers on wikipedia

您可以在维基百科上的Web浏览器比较中查看每个浏览器支持的格式列表


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2014/03/27/6928dd3a9e3282df22e49b2114ab7db4.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com