【发布时间】:2020-04-15 08:24:28
【问题描述】:
我目前正在创建一个网站,几乎完成了,但是有一个问题。 favicon 不会显示在视图源或图像上(在 localhost、chrome 中)。你看,我不确定我做错了什么,或者这只是一个错误。感谢您的帮助。
看,没有图标将显示在视图源中。这与图像相同。 但是如果我跳到谷歌,他们就没有这个问题。
是否因为我在本地主机上而发生此问题,并且当我发布我的网站时它会很好?
谢谢。
。 .
这也是我目前用于我的网站图标的代码:
<link rel="apple-touch-icon" sizes="180x180" href="./css/images/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./css/images/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./css/images/favicons/favicon-16x16.png">
<link rel="manifest" href="./css/images/favicons/site.webmanifest">
<link rel="mask-icon" href="./css/images/favicons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="./css/images/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="test">
<meta name="application-name" content="test">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="./css/images/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
【问题讨论】:
-
你有没有把它命名为
favicon.ico并把它扔到和index.html相同的目录下?很多时候浏览器会自动选择它——不需要faviconhtml标签..但是,添加<link rel="icon" href="favicon.ico"> -
我只是将 favicon.ico 放在与 index.html 相同的目录中,但在 view-source 中仍然没有 favicon。
标签: html favicon view-source