28 lines
576 B
Markdown
28 lines
576 B
Markdown
---
|
||
title: Lang
|
||
localeTitle: 只
|
||
---
|
||
## 郎
|
||
|
||
在HTML中,Lang标签用于声明整个网页或部分网页的语言。
|
||
|
||
### 例子
|
||
|
||
```html
|
||
|
||
<html lang="en">
|
||
</html>
|
||
```
|
||
|
||
lang属性还可用于指定特定元素的语言:
|
||
|
||
```html
|
||
|
||
<p lang="hi">
|
||
फ्री कोड कैंप
|
||
</p>
|
||
```
|
||
|
||
在上面的例子中,“hi”表示印地语。同样,您可以使用“en”表示英语,“es”表示西班牙语,“fr”表示法语等。
|
||
|
||
有关适当的两位数语言代码,请参阅[ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) 。 |