1

我正在加载我最喜欢的图标,如下所示:

  <link rel="icon" type="image/ico" href="images/logoico.ico">

我正在使用 fullpage.js。因此,当我单击一个按钮转到不同的部分时,我的 url 会发生变化:

file://localhost/Users/mauriciosanchezduque/Documents/codeMath/index.html

对此:

file://localhost/Users/mauriciosanchezduque/Documents/codeMath/index.html#secondPage

图标消失了。任何的想法?

4

3 回答 3

3

嗯...根据您提供的链接。当我查看源代码时,我看到

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

但您的网站图标位于此处:http://54.235.78.67/codeMath/images/logo.ico

这里你的路径是错误的,文件名也是错误的。尝试使用这个:

<link rel="icon" type="image/ico" href="images/logo.ico">
于 2014-05-01T05:28:07.630 回答
0

我假设您的网站图标在目录中

file://localhost/Users/mauriciosanchezduque/Documents/codeMath/images

只需将图标的href更改为

file://localhost/Users/mauriciosanchezduque/Documents/codeMath/images/logoico.ico
于 2014-04-30T03:47:54.397 回答
0

我建议您保留此名称favicon.ico并将其放在根目录中。还将这些行放在头上:

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

或者

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

并且文件favicon.ico必须是 16x16 位。

请注意,该文件必须位于根目录中。但是如果你的文件有favicon.ico你甚至不能在你的代码中写上面的那些行

于 2014-04-30T03:51:14.670 回答