I am trying to improve the validity of the HTML on my website, but several errors in the meta tags are showing up as invalid, and I'm unsure how to alter them in order to remove the errors.
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
Run Code Online (Sandbox Code Playgroud)
Bad value X-UA-Compatible for attribute http-equiv on element meta.
<meta name="msvalidate.01" content="4E24196986E1212B82C272A021495004"/>
Run Code Online (Sandbox Code Playgroud)
Attribute name not allowed on element meta at this point.
<meta name="msvalidate.01" content="4E24196986E1212B82C272A021495004"/>
Run Code Online (Sandbox Code Playgroud)
Element meta is missing required attribute itemprop.
<meta name="p:domain_verify" content="5dd1c5f2db0ac0b521f08d56b4cd271b">
Run Code Online (Sandbox Code Playgroud)
Attribute name not allowed on element meta at this point. Element meta is missing required attribute itemprop.
<meta http-equiv="content-language" content="en">
Run Code Online (Sandbox Code Playgroud)
Attribute http-equiv not allowed on element meta at this point. Element meta is missing required attribute itemprop.
<meta http-equiv="content-language" content="en">
Run Code Online (Sandbox Code Playgroud)
使用meta元素指定文档范围的默认语言已过时。考虑改为在根元素上指定语言。
在此先感谢您的帮助!
D.
您必须记住,验证器会说:
验证程序使用以下实验功能检查您的文档: HTML5一致性检查器。为方便起见,已提供此功能,但请注意,它可能不可靠,或者与某些尖端技术的最新发展不完全一致。
如果您的代码使用HTML4,我认为我们可以在道德上说您可以删除其中一些元标记以符合规范,但是目前尚无针对HTML5的明确规范,到目前为止,正在尝试的功能很多这样的结果将/应该在规范中结束,例如能够使用meta标签中的任何名称/内容对,或者具有可以接受http-equiv的功能,或者就此而言,可以使用meta标签的新语法,该文档将来可能会验证。
因此,如果验证对您确实很重要,那么您会有点费劲,因为尚无精确或正确的方法来验证HTML5。删除这些标签将使其针对w3c验证器进行验证,但只会“看起来”有效;甚至对于那些认为验证不只是徽章的人而言。
尽管如此,您可以摆脱
<meta http-equiv="content-language" content="en">
因为您可能会在许多其他属性和位置中指定语言(如果没有,请这样做)。