Chrome 网站图标不显示在谷歌浏览器

yrefmtwq  于 2023-05-27  发布在  Go
关注(0)|答案(2)|浏览(157)

我访问了这些问题,没有一个答案对我有用:
Why doesn't my fav icon work in Chrome any more?
Chrome doesn't show the favicon

我的代码

我的网站是http://mikeyaworski.com,这是我用来设置我的图标的代码:

<head>
    <title>mikeyaworski</title>
    <link 
          rel="shortcut icon" 
          href="http://mikeyaworski.com/myicon.ico" 
          type="image/vnd.microsoft.icon" 
    >   
</head>

我的entire code

What I've Tried

  • 而不是rel="shortcut icon"我尝试了rel="icon"
  • 而不是type="image/vnd.microsoft.icon"我尝试了type="image/x-icon"
  • 而不是href="http://mikeyaworski.com/myicon.ico"我尝试了href="myicon.ico"

该图标在Mozilla和Internet Explorer中工作。该图标在Google Chrome中不起作用。有什么想法吗

tzcvj98z

tzcvj98z1#

您的html无效,您的浏览器尝试修复它。在这样做你的链接标签结束了外面的头部和被忽略,修复您的html和它将工作

<!DOCTYPE>
<html>
  <head>
    <title>mikeyaworski</title>
    <link rel="icon" href="myicon.ico" type="image/vnd.microsoft.icon">

  </head>
  <body>    <!-- body tag should be here -->
    <h1 style="text-align:center;font-family:trebuchet ms;" id="top"><br><br>Hompage</h1>
    <p>
    Coming soon. Until then, view my <a href="http://stackoverflow.com">StackOverflow</a> and other StackExchange profiles:
    </p>

    <a href="http://stackexchange.com/users/2644958">
      <img src="http://stackexchange.com/users/flair/2644958.png?theme=dark" width="208" height="58" alt="profile for mike yaworski on Stack Exchange, a network of free, community-driven Q&A sites" title="profile for mike yaworski on Stack Exchange, a network of free, community-driven Q&A sites">
    </a>

  <body>
</html>
<!-- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> -->
shstlldc

shstlldc2#

请尝试使用以下代码:

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

或者在下面的链接中进行类似的讨论:
local (file://) website favicon works in Firefox, not in Chrome or Safari- why?
更新:或者给予以下链接:Fix missing favicons on Google Chrome
希望这能帮上忙。谢了Jatin

相关问题