gpt4 book ai didi

html - 图标未显示

转载 作者:太空狗 更新时间:2023-10-29 14:15:10 25 4
gpt4 key购买 nike

我正在尝试将网站图标添加到我的网址栏。但它没有出现,我确定路径是正确的,因为当我将它用作普通图像时,它确实出现了。这是 html 代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> title </title>
<link href = "styles.css" rel="stylesheet" type="text/css" />

<link rel="icon" type="image/png" href="../images/favicon.png">

最佳答案

首先,尝试提供完整的 URL。例如 "http://localhost/mysite/images/favicon.png"(实际上根据您的配置进行调整)

否则,在我的网站上,这是可行的:

<link rel="shortcut icon" href="images/favicon.ico" />

尝试:

  1. 将您的 png 转换为 ico。有免费的在线工具,例如http://www.convertico.com/
  2. 确定您的文件夹路径。不会是 ./images 而不是 ../images 吗?否则请尝试提供完整的 URL。例如 “http://localhost/mysite/images/favicon.ico”
  3. 完成上述步骤后,尝试清除浏览器缓存并重新加载网站。

关于html - 图标未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11797094/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com