can't use favicon and style sheet at the same time, they break eachother

馋奶兔 提交于 2019-12-26 05:39:10

问题


here is my problem: I have these 2 tags in my header but they are fighting each other. If I put the rel tag for the shortcut icon below the rel tag for the style sheet (because it is parsed after) my stylesheet breaks and does not display but the icon is there. If I leave it as is the icon does not display. I am obviously doing something wrong but I can't figure it out. Thanks in advance for the help


回答1:


<link rel="shortcut icon" href="tophat2.ico">
<link rel="stylesheet" type="text/css" href="style.css" rel="shortcut icon" href="tophat2.jpg"/> 

Remove the rel="shortcut icon" and the href="tophat2.jpg" in the second tag and close the first one.

<link rel="shortcut icon" href="tophat2.ico"/>
<link rel="stylesheet" type="text/css" href="style.css"/> 



回答2:


Try to delete this line:

And upload your favicon to the web server root and rename it to favicon.ico



来源:https://stackoverflow.com/questions/15193029/cant-use-favicon-and-style-sheet-at-the-same-time-they-break-eachother

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