不能同时使用favicon和样式表,它们会彼此破坏 [英] can't use favicon and style sheet at the same time, they break eachother

查看:108
本文介绍了不能同时使用favicon和样式表,它们会彼此破坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的问题: 我的标头中有这2个标签,但它们相互之间是在战斗.如果我将快捷方式图标的rel标签放在样式表的rel标签下面(因为它在之后被解析),我的样式表会中断并且不会显示,但是图标在那里.如果我将其保留原样,则不会显示该图标.我显然做错了,但我无法弄清楚.预先感谢您的帮助

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

推荐答案

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

删除第二个标签中的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"/> 

这篇关于不能同时使用favicon和样式表,它们会彼此破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆