您是否必须包含< link rel ="图标" HREF ="&的favicon.ico QUOT;类型= QUOT;图像/ X-图标" /> ;?
问题描述:
我的头标中没有包含以下代码行,但是我的图标仍然出现在浏览器中:
I didn't include the following line of code in my head tag, however my favicon still appears in my browser:
<link rel="icon" href="favicon.ico" type="image/x-icon" />
包含它的目的是什么?
What's the purpose of including it?
答
如果您没有调用图标, favicon.ico
,您可以使用该标签指定实际路径将它放在 images /
目录中)。浏览器/网页默认在根目录中查找 favicon.ico
。
If you don't call the favicon, favicon.ico
, you can use that tag to specify the actual path (incase you have it in an images/
directory). The browser/webpage looks for favicon.ico
in the root directory by default.