简体   繁体   English

移动触摸图标

[英]Mobile Touch Icon

I want to have different touch icons in the exact size for the relevant smartphones/tablets. 我想为相关的智能手机/平板电脑使用不同大小的触摸图标。

I tried this: 我尝试了这个:

 <link rel="apple-touch-icon" sizes="76x76" href="http://www.mywebsite.com/img/touch-icon/apple-touch-icon-76.png" /> <link rel="apple-touch-icon" sizes="120x120" href="http://www.mywebsite.com/img/touch-icon/apple-touch-icon-120.png" /> <link rel="apple-touch-icon" sizes="152x152" href="http://www.mywebsite.com/img/touch-icon/apple-touch-icon-152.png" /> <link rel="apple-touch-icon" sizes="180x180" href="http://www.mywebsite.com/img/touch-icon/apple-touch-icon-180.png" /> <link rel="shortcut icon" sizes="196x196" href="http://www.mywebsite.com/img/touch-icon/android-icon.png"> <meta name="msapplication-square70x70logo" content="http://www.mywebsite.com/img/touch-icon/smalltile.png" /> <meta name="msapplication-square150x150logo" content="http://www.mywebsite.com/img/touch-icon/mediumtile.png" /> <meta name="msapplication-wide310x150logo" content="http://www.mywebsite.com/img/touch-icon/widetile.png" /> <meta name="msapplication-square310x310logo" content="http://www.mywebsite.com/img/touch-icon/largetile.png" /> 

That doesn't work for iOS and Android. 这不适用于iOS和Android。 Links might be right, because Windows recognize the different icons. 链接可能是正确的,因为Windows可以识别不同的图标。

Is there any wrong naming or shortcut I don't notice? 我没有注意到任何错误的命名或快捷方式吗?

You either need to make sure that you have a valid and trusted security certificate on the server to use an absolute URL, or you need to use a relative URL: 您需要确保服务器上具有有效且受信任的安全证书才能使用绝对URL,或者需要使用相对 URL:

 <link rel="apple-touch-icon" sizes="76x76" href="img/touch-icon/apple-touch-icon-76.png" /> <link rel="apple-touch-icon" sizes="120x120" href="img/touch-icon/apple-touch-icon-120.png" /> <link rel="apple-touch-icon" sizes="152x152" href="img/touch-icon/apple-touch-icon-152.png" /> <link rel="apple-touch-icon" sizes="180x180" href="img/touch-icon/apple-touch-icon-180.png" /> <link rel="shortcut icon" sizes="196x196" href="img/touch-icon/android-icon.png"> <meta name="msapplication-square70x70logo" content="img/touch-icon/smalltile.png" /> <meta name="msapplication-square150x150logo" content="img/touch-icon/mediumtile.png" /> <meta name="msapplication-wide310x150logo" content="img/touch-icon/widetile.png" /> <meta name="msapplication-square310x310logo" content="img/touch-icon/largetile.png" /> 

See here for more information. 有关更多信息,请参见此处

Hope this helps! 希望这可以帮助!

You might want to submit your site to the RealFaviconGenerator's favicon checker . 您可能需要将站点提交给RealFaviconGenerator的favicon检查器 This online tool analyzes your favicon markups and generates a report. 该在线工具分析您的收藏夹标记并生成报告。 For example, you might discover that your image URLs are invalid or that your images are ill-formed. 例如,您可能发现图像URL无效或图像格式错误。

Full disclosure: I'm the author of this tool. 全面披露:我是这个工具的作者。

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

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