首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未显示Favicon

未显示Favicon
EN

Stack Overflow用户
提问于 2013-11-13 17:42:52
回答 1查看 2K关注 0票数 2

我有个小问题。

在我的一些页面上,我不能让favicon显示。

在一些页面上一切都很好,favicon显示正常,但是在其他网站上我不能让favicon出现。我尝试将ico文件放在主目录中,但没有任何结果。

这个file1.php运行得很好:

代码语言:javascript
复制
<? include("core/config.php"); ?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="include/style.css" rel="stylesheet" type="text/css">
<title>Title</title>
<link rel="shortcut icon" type="image/x-icon" href="img/flavico.fw.ico">
<script type="text/javascript" src="include/script.js"></script>
</head>

然而,在这个图标上没有显示:

代码语言:javascript
复制
<?php include("core/config.php");
include("include/resolution.php"); 
function new_function($nazwa){
global $wys;
global $db;
$wys->some_function($ub,$na,$ub_pod);   
}
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>title</title>
<link rel="shortcut icon" type="image/x-icon" href="img/flavico.fw.ico">
<link href="include/style.css" rel="stylesheet" type="text/css">
</head>

我假设这个问题是由php函数引起的,对吗?

EN

回答 1

Stack Overflow用户

发布于 2013-11-13 17:58:04

请显示两个页面的urls。猜猜你在相对urls中遇到的问题。假设第一个url是http://mysite.org/file1.php,第二个是http://mysite.org/subsecrion/file2.php,那么您应该对favicon使用绝对路径:

代码语言:javascript
复制
<link rel="shortcut icon" type="image/x-icon" href="/img/flavico.fw.ico">

或添加标签:

代码语言:javascript
复制
<base href="http://mysite.org/">
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19950330

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档