HTML 参考手册 HTML 语言代码参考手册

2024-02-25 开发教程 HTML 参考手册 匿名 3

ISO 语言代码

HTML 的 lang 属性可用于声明网页或部分网页的语言,这对搜索引擎和浏览器是有帮助的。

根据 W3C 推荐标准,您应该通过 <html> 标签中的 lang 属性对每张页面中的主要语言进行声明:

比如声明原文版语言:

<html lang="en">
...
</html>

在 XHTML 中,采用如下方式在 <html> 标签中对语言进行声明:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
...
</html>

ISO 639-1 语言代码

ISO 639-1 为各种语言定义了缩略词。您可以在 HTML 和 XHTML 中的 lang 和 xml:lang 属性中使用它们。

语言ISO 代码
Abkhazianab
Afaraa
Afrikaansaf
Albaniansq
Amharicam
Arabicar
Aragonesean
Armenianhy
Assameseas
Aymaraay
Azerbaijaniaz
Bashkirba
Basqueeu
Bengali (Bangla)bn
Bhutanidz
Biharibh
Bislamabi
Bretonbr
Bulgarianbg
Burmesemy
Byelorussian (Belarusian)be
Cambodiankm
Catalanca
Cherokee
Chewa
Chinese (简体)zh
Chinese (繁体)zh
Corsicanco
Croatianhr
Czechcs
Danishda
Divehi
Dutchnl
Edo
Englishen
Esperantoeo
Estonianet
Faeroesefo
Farsifa
Fijifj
Finnishfi
Flemish
Frenchfr
Frisianfy
Fulfulde
Galiciangl
Gaelic (Scottish)gd
Gaelic (Manx)gv
Georgianka
Germande
Greekel
Greenlandickl
Guaranign
Gujaratigu
Haitian Creoleht
Hausaha
Hawaiian
Hebrewhe, iw
Hindihi
Hungarianhu
Ibibio
Icelandicis
Idoio
Igbo
Indonesianid, in
Interlinguaia
Interlingueie
Inuktitutiu
Inupiakik
Irishga
Italianit
Japaneseja
Javanesejv
Kannadakn
Kanuri
Kashmiriks
Kazakhkk
Kinyarwanda (Ruanda)rw
Kirghizky
Kirundi (Rundi)rn
Konkani
Koreanko
Kurdishku
Laothianlo
Latinla
Latvian (Lettish)lv
Limburgish ( Limburger)li
Lingalaln
Lithuanianlt
Macedonianmk
Malagasymg
Malayms
Malayalamml
Maltesemt
Maorimi
Marathimr
Moldavianmo
Mongolianmn
Nauruna
Nepaline
Norwegianno
Occitanoc
Oriyaor
Oromo (Afaan Oromo)om
Papiamentu
Pashto (Pushto)ps
Polishpl
Portuguesept
Punjabipa
Quechuaqu
Rhaeto-Romancerm
Romanianro
Russianru
Sami (Lappish)
Samoansm
Sangrosg
Sanskritsa
Serbiansr
Serbo-Croatiansh
Sesothost
Setswanatn
Shonasn
Sichuan Yiii
Sindhisd
Sinhalesesi
Siswatiss
Slovaksk
Sloveniansl
Somaliso
Spanishes
Sundanesesu
Swahili (Kiswahili)sw
Swedishsv
Syriac
Tagalogtl
Tajiktg
Tamazight
Tamilta
Tatartt
Telugute
Thaith
Tibetanbo
Tigrinyati
Tongato
Tsongats
Turkishtr
Turkmentk
Twitw
Uighurug
Ukrainianuk
Urduur
Uzbekuz
Venda
Vietnamesevi
Volapükvo
Wallonwa
Welshcy
Wolofwo
Xhosaxh
Yi
Yiddishyi, ji
Yorubayo
Zuluzu