How can I avoid the "Bad value language for attribute name on element meta" HTML validation error?
Asked Answered
A

3

5

I'm getting this error when I validate my HTML using the W3C validator:

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

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

How can I solve this?

Ainslee answered 12/4, 2013 at 11:8 Comment(2)
https://mcmap.net/q/1279058/-recommended-meta-elements here is the questions which gives good descriptionJackelynjackeroo
"How can I solve this?" By not using language as a value for the name attribute on the meta tag.Dercy
A
16

Use

<html lang="en">

Source

Ague answered 12/4, 2013 at 11:16 Comment(0)
H
3

You should specify the language on the HTML tag, like so:

<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:

<html lang="en">
    ...
    <body>
        ...
        <div lang="fr"></div>
        ...
    </body>
</html>
Horntail answered 12/4, 2013 at 11:11 Comment(0)
P
0

I think you're looking for content-language

<meta http-equiv="Content-Language" content="en" />
Platen answered 12/4, 2013 at 11:10 Comment(4)
I used that. Now i'm getting error as: Using the meta element to specify the document-wide default language is obsolete. Consider specifying the language on the root element instead. <meta http-equiv="content-language" content="en" />Ainslee
In this case you have to use <html lang="en"> as already replied by several other persons.Platen
@Veena: see @AshBurlaczenko's answerDercy
Bad value Content-Language for attribute name on element meta: Keyword content-language is not registered. The Content-Language value for an http-equiv attribute on a meta element should no longer be used. You should use a language attribute on the html tag to declare the default language of the actual text in the page.Hurlburt

© 2022 - 2024 — McMap. All rights reserved.