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 语法