fav icon does not work in html5 Boilerplate

孤者浪人 提交于 2019-12-24 11:31:17

问题


the fav icon in html5 Boilerplate doesn't work (doesn't show up)

I have tried it on localhost and also on a server but in both the cases it didn't worked. Whats the to make it work .?


回答1:


HTML5 Boilerplate doesn't use link elements for icons by default. Instead, it relies on the browser finding either favicon.ico or apple-touch-icon.png in the root directory.

If you put HTML5 Boilerplate in a sub-directory, whether in localhost or on a server, either no favicon will appear or an existing favicon in the server's root directory will appear. A quick fix for this is to add this line of code in the <head> section of index.html :

<link rel="icon" type="image/png" href="apple-touch-icon.png">

Even better would be to create a 16x16 PNG image (e.g. favicon.png) instead of using the 57x57 apple-touch-icon.png, which gets resized and therefore loses clarity.

See the Favicons and Touch Icons section of the user guide for more details.



来源:https://stackoverflow.com/questions/13116319/fav-icon-does-not-work-in-html5-boilerplate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!