Favicon第一次没有出现 [英] Favicon not showing up for the first time
问题描述
我已经构建了一个AngularJS单页应用程序,它可以正常工作,但是有一个问题:当网站第一次加载时,该图标不会出现.如果我重新加载页面,它将最终显示出来.在我测试过的每个网络浏览器上,它的工作原理都相同:Mozilla Firefox,Chrome,Chromium,IE 9,Android浏览器,iPhone的Safari.
I have build an AngularJS Single Page Application and it works fine, but it has one problem: when the website loads for the first time, the favicon does not appear. If I reload the page, it finally shows up. It works the same on every web browser where I have tested: Mozilla Firefox, Chrome, Chromium, IE 9, Android browser, Safari for iPhone.
这是SPA的常见部分:
This is the common part of the SPA:
<!DOCTYPE html>
<html lang="en" data-ng-app="vannApp" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="Vanntile Ianito" name="author">
<base href="file:///home/vanntile/Documents/doc/WEB_DEVELOPING/Vann_Original/index.html">
<link rel="shortcut icon" href="icon/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="icon/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="icon/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="icon/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="icon/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="icon/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="icon/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="icon/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="icon/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="icon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="icon/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="icon/favicon-194x194.png" sizes="194x194">
<link rel="icon" type="image/png" href="icon/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="icon/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="icon/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="icon/manifest.json">
<title>Website Title</title>
<link href="css/vannstyle.min.css" rel="stylesheet">
<script src="js/angular/angular.min.js"></script>
<script src="js/angular/ui-bootstrap-tpls-0.12.1.min.js"></script>
<script src="js/angular/angular-route.min.js"></script>
<script src="js/angular/angular-animate.min.js"></script>
<script src="js/angular/index.js"></script>
</head>
<body>
<p>This is some text. I could have thought of something better, but I'm lazy.</p>
</body>
</html>
收藏夹图标是使用真实收藏夹生成器制作的.而且,Microsoft磁贴是用 Windows 8.1磁贴制成的.它们不在网站的根目录中,而是在/icon 中.
The favicons are made with Real favicon Generator. And the Microsoft tiles are made with: Windows 8.1 tile. They are not in the root of the website but in /icon.
任何帮助将不胜感激.预先谢谢你.
Any help would be appreciated. Thank you in advance.
推荐答案
您必须首先将 favicon.ico 元标记放在favicon元标记中.以Google页面为例:
You must have put the favicon.ico meta tag the first from the favicon meta tags. Check the google page as an example:
<!DOCTYPE html>
<html lang="en" data-ng-app="vannApp" >
<head>
<meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image">
<link href="/images/branding/product/ico/googleg_lodp.ico" rel="shortcut icon">
这篇关于Favicon第一次没有出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!