大多数浏览器是否会自动搜索favicon.ico? [英] Do most browsers automatically search for the favicon.ico?

查看:147
本文介绍了大多数浏览器是否会自动搜索favicon.ico?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有必要像这样指定它:

 < link rel = iconhref =[URL]type =image / x-icon/> 
< link rel =快捷图标href =[URL]type =image / x-icon/>

或者我可以将它包含在根目录下,浏览器会查找它吗?
rel =icon rel =shortcut

解决方案

所有主要的五个浏览器都会在网站的根目录中查找一个名为 favicon.ico

您可以使用 link 元素覆盖此元素,其中 c $ c> rel =icon rel =快捷图标。后者由每个浏览器支持,而前者更为正确,但无法被Internet Explorer识别。


I would like to know if it is necessary for me to specify it like this:

<link rel="icon" href="[URL]" type="image/x-icon" />
<link rel="shortcut icon" href="[URL]" type="image/x-icon" />

or can I just include it in the root and the browser will look for it? Also what's the difference between rel="icon" and rel="shortcut" ?

解决方案

All of the major five browsers look in the site's root for a file named exactly favicon.ico, regardless of type, automatically.

You can override this with a link element with rel="icon", or rel="shortcut icon". The latter is supported by every browser, while the former is more correct, but not recognised by Internet Explorer.

这篇关于大多数浏览器是否会自动搜索favicon.ico?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆