Mark up language changes within a document
Web documents can have different languages within the same document, or different versions of the document in different languages. HTML markup allows designers to identify the primary language of the document, and to identify words or sections that are in other languages.
For example, if the primary language of a Web page is English, a French word or phrase can be identified as such using the
LANG attribute: for example,
<span lang="fr">C’est la vie</span>. The
LANG attribute applies to different elements, such as links, paragraphs, headings, citations, and tables. When language changes are identified in the code of the page, software can use the information. For example, screen reader software can read the phrase with the appropriate pronunciation.
In order to mark language changes within a document, the primary document language must be identified by applying the
LANG attribute to the HTML tag: for example,
<HTML lang="es"> for documents in Spanish.