问题
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