我想知道我是否已涵盖所有浏览器和设备的所有favicons /启动闪屏?
这够了吗?或者我应该涵盖哪些主要内容?我错过了以下内容:
<link rel="icon" href="/images/favicons/favicon.png">
<link rel="apple-touch-icon" href="/images/favicons/touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="76x76" href="/images/favicons/touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="120x120" href="/images/favicons/touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="152x152" href="/images/favicons/touch-icon-ipad-retina.png">
<meta name="application-name" content="site">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-square70x70logo" content="/images/favicons/msapplication-tiny.png">
<meta name="msapplication-square150x150logo" content="/images/favicons/msapplication-square.png">
<meta name="msapplication-wide310x150logo" content="/images/favicons/msap plication-wide.png">
<meta name="msapplication-square310x310logo" content="/images/favicons/msapplication-large.png">
由于
答案 0 :(得分:11)
适用于桌面浏览器的经典图标
将favicon.ico
文件放在网站的根目录中。 It does not need to be declared和it is expected to contain 16x16, 32x32 and 48x48 pictures。
现代浏览器也会寻找PNG图标。您可以通过以下方式处理大多数情况:
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<强>的iOS 强>
如果您将iOS 6和iOS 7尺寸,iPad和iPhone以及Retina和非Retina结合使用,则会为您提供8 Apple touch icons:
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
<强>的Android 强>
Android Chrome使用Apple touch图标。但它也记录了196x196 PNG icon将取代触摸图标......总有一天。所以:
<link rel="icon" type="image/png" href="/favicon-196x196.png" sizes="196x196">
Windows 8.0平铺图片
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
Windows 8.1平铺图片
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-square70x70logo" content="/images/favicons/msapplication-tiny.png">
<meta name="msapplication-square150x150logo" content="/images/favicons/msapplication-square.png">
<meta name="msapplication-wide310x150logo" content="/images/favicons/msapplication-wide.png">
<meta name="msapplication-square310x310logo" content="/images/favicons/msapplication-large.png">
或使用放置在您网站根目录中的browserconfig.xml
(或在head
部分中声明),其中包含以下内容:
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/mstile-70x70.png"/>
<square150x150logo src="/mstile-150x150.png"/>
<square310x310logo src="/mstile-310x310.png"/>
<wide310x150logo src="/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
其他人
Google TV,Opera Speed拨号和其他人怎么样?他们期待PNG图标:
<link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
(...)
生成这些图片和HTML代码
You can generate all these pictures and HTML code at once。完全披露:我是本网站的作者。
答案 1 :(得分:0)
您可以在第一行使用.ico而不是.png
<link rel="icon" href="/images/favicons/favicon.ico">