简体   繁体   English

是否可以使用apple-touch-icon作为网站图标?

[英]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.

相关问题 一旦将webapp添加到主屏幕,是否可以强制iphone / ipod更新apple-touch-icon? - Is it possible to force iphone/ipod to update apple-touch-icon once webapp is added to home screen? Android 4.4 HTML apple-touch-icon无法正常工作? - Android 4.4 HTML apple-touch-icon not working? 从移动网站解析apple-touch-icon - Parse apple-touch-icon from mobile websites 从web应用程序动态更新ios apple-touch-icon - dynamic update ios apple-touch-icon from web app 为什么这个苹果触摸图标不起作用? - Why won't this apple-touch-icon work? 重复请求apple-touch-icon-precomposed.png,并在头部设置了apple-touch-icon - Repeated Requests for apple-touch-icon-precomposed.png with apple-touch-icon set in head 如何使用Javascript或Jquery获取网站图标/ Apple-touch图标和网页标题? - How to get favicon icon/ Apple-touch icon and title of a web page using Javascript or Jquery? Stack Overflow如何做到这一点,从而使其Apple-Touch-icon不具有边框效果 - How does Stack Overflow make it so their apple-touch-icon doesn't have a border effect 为什么使用<link rel=“apple-touch-icon image_src” …> ? - Why use <link rel=“apple-touch-icon image_src” …>? 无法使用nuxt.js应用程序在书签中显示apple-touch-icon - Cannot show apple-touch-icon in bookmarks with nuxt.js app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM