简体   繁体   English

如何正确设置iPhone的favicon?

[英]How to properly set favicon for iPhone?

I have generated favicon on realfavicongenerator.net , but the favicon is not displayed in Safari on iPhone 6S. 我已经在realfavicongenerator.net上生成了收藏夹图标,但是收藏夹图标未显示在iPhone 6S的Safari中。 I have cleared history and website data, but it doesn't help. 我已经清除了历史记录和网站数据,但这无济于事。 Here is my HTML code: 这是我的HTML代码:

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/apple-touch-icon-precomposed.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="194x194" href="/favicon-194x194.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">

<link rel="icon" type="image/x-icon" href='/favicon.ico' />
<link rel="shortcut icon" type="image/x-icon" href='/favicon.ico' />

As you see, I added rel="icon" and rel"shortcut icon" and also precomposed favicon, but nothing helps. 如您所见,我添加了rel =“ icon”rel“ shortcut icon” ,还预组合了图标图标,但没有任何帮助。 I have looked on the Internet and couldn't find a solution. 我在互联网上看过,找不到解决方案。 Is there anything else I can do? 我还能做些什么吗?

Full disclosure: RealFaviconGenerator's author speaking. 完整披露:RealFaviconGenerator的作者发言。

First, you should run the favicon checker against your site, to spot errors such as invalid URLs. 首先,您应该针对您的网站运行网站图标检查器 ,以发现错误,例如无效的URL。

If the test is positive, you can be confident that your touch icon is configured correctly. 如果测试为阳性,则可以确信触摸图标已正确配置。 You probably have a caching issue, even if you have cleared your browser cache. 即使您已清除浏览器缓存,也可能存在缓存问题。 As a workaround, you can try with another device or wait for a few hours and retry. 解决方法是,您可以尝试使用另一台设备或等待几个小时然后重试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM