简体   繁体   English

验证错误“元素链接上属性 rel 的错误值 apple-touch-icon-precomposed:未注册关键字 apple-touch-icon-precomposed。”

[英]Validation error “Bad value apple-touch-icon-precomposed for attribute rel on element link: Keyword apple-touch-icon-precomposed is not registered.”

I'm getting this error in w3C HTML 5 validator我在 w3C HTML 5 验证器中收到此错误

Line 9, Column 101: Bad value apple-touch-icon-precomposed for attribute rel on element link: Keyword apple-touch-icon-precomposed is not registered.第 9 行,第 101 列:元素链接上属性 rel 的错误值 apple-touch-icon-precomposed:关键字 apple-touch-icon-precomposed 未注册。 …-icon-precomposed" sizes="72x72" href="images/sl/touch/m/apple-touch-icon.png"> Syntax of link type valid for: A whitespace-separated list of link types listed as allowed on in the HTML specification or listed as an allowed on on the Microformats wiki …-icon-precomposed" sizes="72x72" href="images/sl/touch/m/apple-touch-icon.png"> 链接类型的语法适用于: 以空格分隔的链接类型列表,允许在在 HTML 规范中或在微格式 wiki 上列为允许

How to fix this error?如何修复此错误?

Ignore it.忽略它。

If that's the only error you have, then your document is valid HTML5.如果这是您唯一的错误,那么您的文档是有效的 HTML5。

Here's what the official (in development) spec states about the <meta> tag: Extensions to the predefined set of metadata names may be registered .以下是官方(开发中)规范对<meta>标签的说明可以注册预定义的元数据名称集的扩展 I can't find the area in the spec that talks about the "ref" tag values, but the validator treats them similarly (one for links, one for strings), and points us to the extension Wiki .我在规范中找不到讨论“ref”标签值的区域,但验证器对它们的处理方式类似(一个用于链接,一个用于字符串),并将我们指向扩展 Wiki You 'may' register them, but don't have to.您“可以”注册它们,但不是必须的。 In RFC terminology this is a SHOULD not a MUST .在 RFC 术语中,这是一个SHOULD而不是MUST

The spec doesn't seem to mandate a fixed list, or use of the Wiki.该规范似乎没有规定一个固定列表或使用 Wiki。 Doing so would seem odd, as these fields have often evolved with time.这样做似乎很奇怪,因为这些领域经常随着时间而发展。 It does state that Conformance checkers must use the information given on the WHATWG Wiki MetaExtensions page to establish if a value is allowed or not: values defined in this specification or marked as "proposed" or "ratified" must be accepted. state 规定,一致性检查人员必须使用 WHATWG Wiki MetaExtensions 页面上提供的信息来确定是否允许某个值:必须接受本规范中定义或标记为“建议”或“已批准”的值。 which is an interesting line as it is a specification for the HTML Validators , not HTML5 itself, and doesn't itself make the markup invalid.这是一条有趣的行,因为它是 HTML Validators的规范,而不是 HTML5 本身,并且本身不会使标记无效。

In fact, many of these "extensions" are already in the wiki (including your one ), they just haven't been accepted.事实上,许多这些“扩展”已经在 wiki 中(包括你的),它们只是没有被接受。 Same with many meta tags, even very common ones.与许多元标记相同,甚至是非常常见的标记。 It seems many won't be accepted either.似乎很多人也不会被接受。

I think it's very nice of the W3C to create a standardised list of these.我认为 W3C 创建一个标准化列表非常好。 It helps developers know what they should be using now and in the future (and can hopefully clean up some things linke reducing the number of ways you can specify a creation date from 5+ to 1).它可以帮助开发人员知道他们现在和将来应该使用什么(并且希望可以清理一些链接,将您可以指定创建日期的方式从 5+ 减少到 1)。

Unfortunately we are dealing with third parties here (eg Apple) – and unless you want to contact every third party who has created one of these informal specification, and tell them to formalize a spec, and submit it to the W3C's list (which may or may not get accepted) what are you to do?不幸的是,我们在这里与第三方(例如 Apple)打交道——除非您想联系创建这些非正式规范之一的每个第三方,并告诉他们正式制定规范,并将其提交给 W3C 的列表(可能或可能不会被接受)你要做什么? At the end of the day you still need to support it.归根结底,您仍然需要支持它。

Anyway, isn't the very point of having these HTML elements to support extensions so vendors don't break the spec by adding new elements to do what the need?无论如何,让这些 HTML 元素支持扩展以使供应商不会通过添加新元素来满足需求而破坏规范不是很重要吗?

If you move the touch icons into your web root and follow the Apple documentation for naming conventions, you won't actually need to insert the link tags in your HTML and will avoid those validation errors.如果您将触摸图标移动到 web 根目录并遵循Apple 文档的命名约定,您实际上不需要在 HTML 中插入链接标签,并且会避免这些验证错误。

The iOS devices will look for the icons in the web root automatically, using the predefined naming conventions and the correct resolution as also outline here . iOS 设备将自动在 web 根目录中查找图标,使用预定义的命名约定和正确的分辨率,也如此所述。 Good luck.祝你好运。

Delete the element from your source.从源中删除元素。

You probably don't want to do that though.不过,您可能不想这样做。 Remember that validation is a tool, not a competition.请记住,验证是一种工具,而不是竞争。

You might want to edit the wiki of supported link types and then wait for the validator to catch up.您可能想要编辑支持的链接类型的 wiki ,然后等待验证器跟上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM