HTML - language (lang|xml:lang) attribute

> (World Wide) Web - (W3|WWW) > HyperText markup Language (HTML)

1 - About

The lang attribute can specified:

3 - Namespace

3.1 - No

In no namespace, the language attribute specifies the primary language for the element's contents and for any of the element's attributes that contain text.

Its value must be:

  • a valid BCP 47 language tag,
  • or the empty string (unknown primary language)

The lang attribute is a global attributes.

Advertising

3.2 - Xml

The lang attribute is also defined in the XML namespace.

The lang attribute in the XML namespace xml:lang may be used:

  • on HTML elements in XML documents,
  • as well as elements in other namespaces if the relevant specifications allow it.

The following specifications allow lang attributes in the XML namespace to be specified on their elements).

4 - Documentation / Reference

web/html/lang.txt · Last modified: 2019/02/09 11:29 by gerardnico