Files
freeCodeCamp/guide/chinese/html/attributes/lang/index.md
2018-10-16 21:32:40 +05:30

28 lines
576 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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) 。