CSS :lang() 偽類
示例
將 lang 屬性值為 "it"(義大利語)的任何 <p> 元素設為樣式
p:lang(it) {
background-color: yellow;
font-style: italic;
}
自己動手試一試 »
定義和用法
The :lang()
pseudo-class is used to select elements with a lang attribute with the specified value.
注意: lang 屬性值通常是兩個字母的語言程式碼,如 lang="fr"(法語),或者兩個語言程式碼的組合,如 lang="fr-ca"(加拿大法語)。
版本 | CSS2 |
---|
瀏覽器支援
表中數字表示該偽類完全支援的第一個瀏覽器版本。
偽類 | |||||
---|---|---|---|---|---|
:lang() | 4.0 | 8.0 | 2.0 | 3.1 | 9.6 |
CSS 語法