[英]is using apple-touch-icon as favicon possible?
I have noticed that HTML5 Boilerplate and dev websites like css-tricks.com use only apple-touch-icon as any reference to favicon, and that image is indeed displayed in a browser. 我注意到HTML5 Boilerplate和css-tricks.com之类的开发网站仅使用apple-touch-icon作为favicon的引用,并且该图像确实显示在浏览器中。 I was not following this topic for a while and am confused to how this works.
我有一段时间没有关注这个主题,并且对它的工作方式感到困惑。 Is it safe to now only include a touch-icon and will it be displayed in various browsers?
现在只包含一个触摸图标是否安全?它会在各种浏览器中显示吗?
A favicon.ico file is used by the browser automatically if it's in the root directly of your page/app. 如果favicon.ico文件直接在页面/应用程序的根目录中,则浏览器会自动使用它。
If you want to add a favicon in a different format (eg png
), of you want to add it from another source (eg a subdirectory like /img
) or if you want to make the browser load a new version of the file (eg favicon.ico?v=2
) you use the link tag. 如果你想以不同格式添加一个图标(如
png
),你想从另一个来源添加(例如像一个子目录/img
),或者如果你想在浏览器中加载该文件的新版本(例如, favicon.ico?v=2
),您可以使用链接标记。
More info here: Necessary to add link tag for favicon.ico? 更多信息在这里:是否需要为favicon.ico添加链接标签?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.