简体   繁体   English

如何避免“元素元素属性名称的错误值语言”HTML验证错误?

[英]How can I avoid the “Bad value language for attribute name on element meta” HTML validation error?

I'm getting this error when I validate my HTML using the W3C validator : 当我使用W3C验证器验证我的HTML时,我收到此错误:

Bad value language for attribute name on element meta: Keyword language is not registered.

<meta name="language" content="en" />

How can I solve this? 我怎么解决这个问题?

Use 使用

<html lang="en">

Source 资源

You should specify the language on the HTML tag, like so: 您应该在HTML标记上指定语言,如下所示:

<html lang="en">

You can also ues the lang attribute on any element, so if you have just one div with French in it, you could do: 你也可以使用任何元素的lang属性,所以如果你只有一个包含法语的div,你可以这样做:

<html lang="en">
    ...
    <body>
        ...
        <div lang="fr"></div>
        ...
    </body>
</html>

我想你正在寻找内容语言

<meta http-equiv="Content-Language" content="en" />

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

相关问题 元素元属性名称的Google值错误 - Bad value google for attribute name on element meta W3C验证程序:“元素元数据上属性名称的错误值机器人” - W3C validator: “Bad value robots for attribute name on element meta” 错误:元素元数据上的属性http-equiv的值X-UA-兼容错误 - Error: Bad value X-UA-Compatible for attribute http-equiv on element meta 在XHTML5验证中摆脱“ XHTML元素元上的属性http-equiv的值X-XRDS-Location无效”。 - Get rid of “Bad value X-XRDS-Location for attribute http-equiv on XHTML element meta.” in XHTML5 validation “元素meta上的属性http-equiv的错误值到期” - “Bad value expires for attribute http-equiv on element meta” 验证:元素链接上的属性rel首先出现错误值 - Validation: Bad value first for attribute rel on element link ARIA验证错误:属性角色的错误值滑块 - ARIA validation error: Bad value slider for attribute role 元素meta上的属性http-equiv的错误值缓存控制 - Bad value cache-control for attribute http-equiv on element meta html5视频元素-如何获得其名称 - html5 video element - how can I get its name 验证错误“元素链接上属性 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.”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM