Latest web development tutorials

HTML lang attribute

HTML Global Attributes HTML Global Attributes

Examples

Paragraph contains some of the French:

<P lang = "fr"> This is a paragraph. </ P>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the lang attribute


Definition and Usage

lang attribute specifies the language of element content.


Differences between HTML 4.01 and HTML5

In HTML5, lang attribute can be used with any HTML element (it will verify that any HTML element, but not necessarily useful).

In HTML 4.01, lang attribute can not be used: <base>, <br>, <frame>, <frameset>, <hr>, <iframe>, <param>, and <script>.


grammar

<Elementlang = "language_code">

Property Value

value description
language_code Predetermined element content language code. Language code reference manual. Language Code Reference Manual


HTML Global Attributes HTML Global Attributes