【问题标题】:Favicon not working on webpage in IE10 and belowFavicon 在 IE10 及以下版本的网页上不起作用
【发布时间】:2014-07-30 07:33:20
【问题描述】:

为什么此网页上的图标在 IE10 及更低版本中不起作用?网页是here。它适用于 IE11 以及其他主要浏览器。

这是页面顶部的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" lang="en"> 
    <head>
        <title>...</title>
        <meta http-equiv="X-UA-Compatible" content="IE=8,IE=9" >
        <!-- (various stylesheet, script, and meta declarations) -->
        <link rel="Shortcut Icon" href="/riteAid-theme/images/custom/riteaid.ico" />
        <!-- (more stylesheets and scripts) -->
        <link rel="canonical" href="..." />
    </head>

我尝试过的事情(无济于事):

  • 在链接声明中设置type="image/x-icon"
  • 在链接声明中设置rel="icon"
  • 将声明设置在头部更高的位置。
  • 将图标名称更改为favicon.ico

我在尝试之间使用了一个新的虚拟机实例,所以缓存不是问题。

【问题讨论】:

  • 您是否尝试过将 rel 小写(不知道这是否真的会有所作为)?这是我通常使用的声明,它适用于所有浏览器:&lt;link rel="shortcut icon" href=".../favicon.ico"&gt;。它也可能是一个编码错误的 .ico 文件。您也可以随时为图片使用 .png

标签: html internet-explorer-8 internet-explorer-9 internet-explorer-10 favicon


【解决方案1】:

.ico 文件的格式似乎有误(PNG 或 GIF)。见this question

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-19
    • 1970-01-01
    • 1970-01-01
    • 2013-07-02
    • 2013-12-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多