Why does my favicon not show up?

后端 未结 4 1391
情歌与酒
情歌与酒 2020-12-16 09:11

The following is used to set the favicon in my html code:


However, the

4条回答
  •  半阙折子戏
    2020-12-16 09:44

    Favicons only work when served from a web-server which sets mime-types correctly for served content. Loading from a local file might not work in chromium. Loading from an incorrectly configured web-server will not work.

    Web-servers such as lighthttpd must be configured manually to set the mime type correctly.

    Because of the likelihood that mimetype assignment will not work in all environments, I would suggest you use an inline base64 encoded ico file instead. This will load faster as well, as it reduces the number of http requests sent to the server.

    On POSIX based systems you can base64 encode a file with the base64 command.

    To create a base64 encoded ico line use the command:

    $ base64 favicon.ico --wrap 0
    

    And insert the output into the line:

    
    

    Replacing the word HERE like so:

    
    

提交回复
热议问题