Why doesn't my fav icon work in Chrome any mor

2019-09-21 05:56发布

问题:

My favicon worked on Chrome Canary for a while, and after I updated it it stopped appearing.

I have provided my code below.

<html>
    <head>
        <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
        <title>Write IT</title>
    </head>
    <body>
    </body>
</html>

回答1:

The correct MIME-type for .ico files is image/vnd.microsoft.icon. Since image/x-icon is not standardized it's most often a leniency of a browser not checking for it if it actually works.