在Google云端硬盘托管网站上展示favicon

时间:2014-03-14 13:29:43

标签: google-drive-api favicon

我把这个favicon放在html中:

<link rel='shortcut icon' type='image/x-icon' href='favicon.ico' />

...但是在使用Google Chrome访问时,它会显示Google云端硬盘的徽标,而不是我的图标。

这不会发生在Firefox上,只会发生在Chrome上。那么有什么方法可以强制我的favicon显示在谷歌驱动器托管的网页上?谢谢!

4 个答案:

答案 0 :(得分:0)

为我的文件名添加查询字符串对我有用:

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico?v=2" />

请参阅:“How do I force a favicon refresh

答案 1 :(得分:0)

来自Google云端硬盘产品论坛:

<link rel="shortcut icon" href="favicon.ico" type="x-icon">
        <link rel="icon" href="favicon.ico" type="x-icon">

https://productforums.google.com/forum/#!msg/drive/03pmip5YJiY/WVTn_2qGm4cJ

答案 2 :(得分:0)

我使用Styleshout模板并将其托管在Google云端硬盘上。他们在index.html文件头中的代码是:

<link rel="shortcut icon" href="favicon.png" >

无论我把它作为&#34; favicon.png&#34;在网站的根目录中显示为favicon。

我将此代码添加到显示Google云端硬盘图标的其他网站的标题中,它开始显示我放置的任何内容&#34; favicon.png&#34;代替。

他们使用的是.png文件而不是.ico文件,但它有效。此外,您可以使用其他大小的.png文件,而不仅仅是16x16。

答案 3 :(得分:0)

您必须使用包含index.html(和js,favicon,css)的文件夹ID 构建您的网址,而不是index.html的文件ID(我想这是你正在做什么,因为我有同样的问题)。

不使用此ID:

enter image description here

使用此代替: enter image description here

其中“casacas”是放置index.html文件和favicon.ico(加上js,css,images)并配置了公共访问权限的文件夹。 enter image description here

然后,在你的html中简单使用:

<link rel="icon" href="favicon.ico">

enter image description here

相关问题