Pages

Thursday 31 December 2015

The lang Attribute

The lang Attribute

The document language can be declared in the <html> tag.
The language is declared in the lang attribute.
Declaring a language is important for accessibility applications (screen readers) and search engines:
<!DOCTYPE html>
<html lang="en-US">
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>
The first two letters specify the language (en). If there is a dialect, use two more letters (US).

No comments:

Post a Comment