Home >Web Front-end >HTML Tutorial >HTML specifies the language attribute lang of the element content

HTML specifies the language attribute lang of the element content

黄舟
黄舟Original
2017-11-03 13:07:482321browse

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=&#39;en&#39;></html> //英文
  <html lang=&#39;zh&#39;></html> //中文
   <html lang=&#39;ja&#39;></html> //日文
    <html lang=&#39;en-us&#39;></html> //美式英文

Note: The language code in the lang attribute is not case-sensitive

 <html lang=&#39;en-us&#39;></html> //英文
 <html lang=&#39;en-us&#39;></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=&#39;en&#39;>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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn