讓網站在瀏覽器分頁、書籤、位址列顯示專屬圖示,只需兩步驟。
.ico 圖示檔 (可用線上轉換工具或 Photoshop 外掛),命名 favicon.ico。index.html 同層)。<head>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<!-- 相容舊 IE -->
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
</head>
rel="icon":HTML5 標準。rel="shortcut icon":IE 相容寫法。/favicon.ico,明確宣告可避免 404 日誌雜訊並支援子目錄頁面。<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="manifest" href="/site.webmanifest">
建議使用 RealFaviconGenerator 一鍵產出全平台圖示包與 HTML 代碼。