我有不同的ipad,iphone和其他设备图标。
是否可以使用外部文件引用所有这些内容?或者我是否需要在每个页面的头部分粘贴所有这些链接?
<link rel="apple-touch-icon" href="img/apple-touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/apple-touch-icon-iphone-retina-display.png">
<link rel="shortcut icon" href="img/favicon.ico">
答案 0 :(得分:0)
您不必在每个页面中声明Apple touch图标。没有“外部文件”技术,但是Apple defines both declarations and file naming conventions.您可以使用这些约定来避免额外的HTML代码。
要做到这一点:
link
标记。/
)中。apple-touch-icon-72x72.png
,apple-touch-icon-114x114.png
等。iOS设备仍然可以找到它们。这种做法的警告提示:对于iOS设备,这是可以的。但是其他一些平台,比如Android,也使用这些图标。这些平台可能无法使用Apple定义的约定(声明支持更为广泛)。
关于图标尺寸的另一个注意事项:72x72和114x114适用于iOS 6及之前版本。确保定义Apple touch icons with the right sizes。