Define Language
All web documents should have a clear definition of the language of the content. If the language changes throughout the document, then that also needs to be made clear.
Why
Specifying language allows speech synthesizers to adapt pronunciation, braille translation software to substitute controls for accented characters, etc...
Best Practices
- All pages should begin with:
<html lang="en">
- If language is changing, make that clear by adding the lang attribute to individual elements on the page:
<div lang="en">
The quick brown fox jumps over the lazy dog
</div>
<div lang="de"
Der schnelle braune Fuchs springt über den faulen Hund
</div>