0

我目前正在努力提高网站的可访问性。我正在使用 TotalValidator 工具来检查那里的可访问性问题,以及

那里的图标使用这种格式:

<link href="/full/path/to/the/image/120.png" rel="apple-touch-icon" />
<link href="/full/path/to/the/image/152.png" rel="apple-touch-icon" sizes="152x152" />
<link href="/full/path/to/the/image/167.png" rel="apple-touch-icon" sizes="167x167" />
<link href="/full/path/to/the/image/180.png" rel="apple-touch-icon" sizes="180x180" />
<link href="/full/path/to/the/image/192.png" rel="icon" sizes="192x192" />
<link href="/full/path/to/the/image/128.png" rel="icon" sizes="128x128" />

我搜索了这个主题,这种格式似乎是正确的,但可访问性报告抛出:

此处不允许使用“尺寸”属性。

有谁知道我应该如何更换它?谢谢!

4

1 回答 1

1

根据@Darek Kay,本文档指的是:

sizes 属性给出了视觉媒体图标的大小。[...] 不得在没有指定 icon 关键字或 apple-touch-icon 关键字的 rel 属性的链接元素上指定该属性。

注意:apple-touch-icon 关键字是预定义的一组链接类型的注册扩展,但用户代理不需要以任何方式支持它。

谢谢!

于 2020-09-28T09:40:24.177 回答