Contribute on GitHub

Web Accessibility Best Practices

Tips and tricks for beginners and experts alike.

Human-readable language specification in HTML

Examples

Single language (document-wide, HTML only; sufficient in most cases)

<html lang="en">

Single language (document-wide, XHTML & HTML)

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

In-line language specification

Example 1
<p>"<span lang="fr">Bonjour!</span>," the man said.</p>
Example 2
<div>
<p>Translate this site into <span title="Spanish"><a lang="es" href="qa-html-language-declarations.es">EspaƱol</a></span></p>
</div>