2017-01-24 73 views
0

將favicon文件添加到github頁面未實現Favicon

並粘貼下面的代碼。它雖然不工作!我在鍍鉻。可能是什麼問題呢?

<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" /> 
+1

是根文件夾中的圖像,因爲您使用前導'/'引用它們?也許你需要調整路徑 –

+0

我同意@ThomasAltmann,它可能只是錯誤的路徑。 – rohanharrison

+0

@ThomasAltmann抱歉,不知道根文件夾是什麼......這就是我所做的http://imgur.com/a/Jk5j6我該怎麼辦?如何調整路徑..? – user2277916

回答

1

嘗試重置cookies在你的瀏覽器(Chrome瀏覽器只是ctrl+shift+r

入住開發者控制檯,如果沒有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"> 
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">