【发布时间】:2011-10-12 01:11:28
【问题描述】:
我的网站中有以下代码:
<link rel="apple-touch-icon" href="http://website.com/images/apple-touch-icon.png" />
当我在 Firefox 中查看源代码并单击图标显示的 href 属性时(因此它不是 404 错误)。
当将代码添加到http://website.com/mobile/index.php 或http://website.com/mobile/page.php 之类的页面并将该页面添加到iPhone 主屏幕时,图标可以正常工作,但是当页面URL 类似于http://website.com/page 或http://website.com/index 时,图标不会不出现。
Safari 选项中提供的“网站调试控制台”中没有出现错误,我已尝试清除缓存和 cookie。
我还使用标签<base href="http://website.com/mobile/" /> 网站,该标签显示在http://website.com/mobile/index.php 和http://website.com/index 上。但我看不出这会如何影响它,因为 apple-touch-icon 使用完整的 url。
【问题讨论】:
-
作为最后的手段,您可以将图像放在站点的根文件夹中,这样就不需要链接元素。 PS是链接元素存在于所有页面吗?
标签: iphone html mobile safari apple-touch-icon