Favicon没有实施

时间:2017-01-24 20:21:34

标签: html css favicon

将favicon文件添加到github页面

并粘贴以下代码。虽然它不起作用!我是关于铬的。可能是什么问题呢?

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
    <link href="fonts.googleapis.com/css?family=Lato:100,300,400,700,900"; rel="stylesheet" />
    <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
    <link rel="icon" type="image/png" sizes="192x192"  href="/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
    <link rel="manifest" href="/manifest.json">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

2 个答案:

答案 0 :(得分:2)

尝试在浏览器中重置Cookie(仅限ctrl+shift+r中的Chrome)

检查开发者控制台是否没有404错误和图标。

就像你需要的一样:

<link rel="apple-touch-icon" sizes="180x180" href="apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192"  href="android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="apple-icon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="apple-icon-16x16.png">

答案 1 :(得分:0)

href属性中的路径错误。您告诉浏览器它们位于项目的根目录中(在这种情况下,这是在github中打开页面时出现的第一件事,your screenshot as reference

您有一个名为Favicon.ico的文件夹(我会将其更改为icons,因为.ico通常与文件相关联)

因此,在您的HTML中,您必须调整路径,以便浏览器知道这些图标在哪个目录中,例如:

<link rel="icon" type="image/png" sizes="32x32" href="/Favicon.ico/favicon-32x32.png">