gpt4 book ai didi

html - HTML 5 的验证错误

转载 作者:太空狗 更新时间:2023-10-29 15:36:57 25 4
gpt4 key购买 nike

Validation errors

我遇到了一系列疯狂的错误。我正在使用 Bootstrap 代码并且没有对其进行编辑。那么为什么会显示错误呢?

A link element with a sizes attribute must have a rel attribute that contains the value icon or the value apple-touch-icon.

Bad value banner for attribute role on element nav.

要现场观看相同的内容,请访问 https://validator.w3.org/nu并输入:www.iqtests4kids.com/

最佳答案

这里是 W3C HTML 检查器(验证器)的维护者。 rel=apple-touch-icon-precomposed 错误是因为我最近更新了检查器以符合 HTML spec requirements for sizes :

The sizes attribute is used with the icon link type. The attribute must not be specified on link elements that do not have a rel attribute that specifies the icon keyword or the apple-touch-icon keyword.

role=bannernav上的错误,是因为检查器符合HTML规范中ARIA的要求nav must not have any role other than navigation .

但请注意 HTML 规范中的 ARIA also states the following requirement :

Web developers should not set the ARIA role and aria-* attributes to values that match the implicit ARIA semantics defined in the table.

引用的“表格”中的要求指出the implicit semantics of nav are navigation .

因此,如果您将 role=navigationnav 一起使用,检查器将发出警告。

所以底线是,根据 HTML 要求中的 ARIA,nav 永远不应具有明确的角色

关于html - HTML 5 的验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41396853/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com