Home >Web Front-end >HTML Tutorial >HTML specifies the language attribute lang of the element content
Example
Some French in the paragraph:
<p lang="fr">Ceci est un paragraphe.</p>
Browser support
All browsers support the lang attribute.
Definition and Usage
The lang attribute specifies the language of the element content.
Tips and Notes
Note: The lang attribute is not valid in the following tags: dde6fb694e6711ae5e6f381704c04ae4, 0c6dc11e160d3b678d68754cc175188a, 04a0d55efbbfd646a993fbc01f262c57, 39dbb14d97cb8035beb9a1f8616c8192, f32b48428a809b51f04d3228cdf461fa, d5ba1642137c3f32f4f4493ae923989c, 0c68fef83818661b6da588c77ca3985e and 3f1c4e4b6b16bbbd69b2ee476dc4f83a.
Syntax
<element lang="language_code">
Attribute value
Value | Description |
language_code | Specifies the language code of the element content. |
The lang attribute written in the html tag functions: declares the language type of the current page.
For example:
<html lang='en'></html> //英文 <html lang='zh'></html> //中文 <html lang='ja'></html> //日文 <html lang='en-us'></html> //美式英文
Note: The language code in the lang attribute is not case-sensitive
<html lang='en-us'></html> //英文
<html lang='en-us'></html> //英文
The above two lines of code have the same effect.
In addition, the lang attribute can also be added to ordinary tags.
Such as:
<div lang='en'>this is English .</div>
The above is the detailed content of HTML specifies the language attribute lang of the element content. For more information, please follow other related articles on the PHP Chinese website!