freeCodeCamp/guide/chinese/html/attributes/lang/index.md

28 lines
576 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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