我正试着在我的网址栏上添加一个收藏图标。但它没有显示,我确信路径是正确的,因为当我将其用作正常图像时,它确实会显示出来。下面是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">发布于 2012-08-03 22:12:30
首先,试着给出完整的URL。例如"http://localhost/mysite/images/favicon.png" (实际上,让它适应您的配置)
否则,在我的网站上,这是可行的:
<link rel="shortcut icon" href="images/favicon.ico" />尝试:
./images而不是../images?否则,请尝试提供完整的URL。例如"http://localhost/mysite/images/favicon.ico"。发布于 2012-08-03 21:56:55
使用<link rel="icon" type="image/png" href="../images/favicon.png">
参见W3C howto。
但是,您选择的图像格式必须是16x16像素或32x32像素,使用8位或24位颜色。
发布于 2012-08-03 21:54:34
您的rel属性需要为icon,而不是shortcut icon。
有几种方法可以设置收藏夹图标,但我使用以下方法:
<link rel="icon" type="image/png" href="<?= base_url('assets/images/logos/favicon.png'); ?>" /> https://stackoverflow.com/questions/11797094
复制相似问题