Skip to content Skip to sidebar Skip to footer

Html Validation Error For Html Lang Attribute

I am getting this error message: This document appears to be Lorem ipsum text but the html start tag has lang='en'. Consider using lang='zxx' (or variant) instead. From line 5, co

Solution 1:

You're using lorem ipsum, which isn't English. Changing the language attribute to zxx should fix the validation warning. zxx is used when the language is unknown.

Your options:

  1. Change en to zxx --- html lang="zxx"
  2. Replace lorem ipsum with English dummy text and keep en
  3. Ignore the warning until you update your page with real content

https://github.com/validator/validator/issues/321

Solution 2:

Use lang="zxx" to tagging text with no language.

You can use lang attributes in your block and inline elements like <p>, <span>, <a> etc., as long as your page is in English, for example:

<plang="zxx">Lorem ipsum</p>

Webpage in English language:

<!DOCTYPE html><htmllang="en"><head><title>Test</title><metacharset="utf-8"></head><body>
    ...
    <!-- Elements in English: without lang attribute --><p>Hello World</p>
    ...
    <!-- Elements in other languages: with lang attribute --><plang="de">Hallo Welt</p>
    ...
    <!-- Elements with Unknown language: with lang (zxx) attribute --><plang="zxx">Lorem ipsum</p>
    ...
    <!-- Mixed --><p>This Page contains <spanlang="zxx">Lorem ipsum</span> Text!</p><p>German Words like: <spanlang="de">Hallo, Welt</span></p><plang="zxx">Lorem ipsum <spanlang="en">Hello World</span></p><p>The language is in <spantitle="Spanish"lang="es">EspaƱol</span></p>
    ...
</body></html>

Or HTML language declaration for unknown language:

<!DOCTYPE html><htmllang="zxx"><head><title>Lorem ipsum</title><metacharset="utf-8"></head><body>
    ...
    <!-- don't need lang attribute --><p>Lorem ipsum dolor sit amet</p>
    ...
    <!-- The language is known --><plang="en"title="English">Hello World</p><plang="de"title="German">Hallo Welt</p>
    ...
</body></html>

Post a Comment for "Html Validation Error For Html Lang Attribute"