在css的一个规则中看到q:lang(no){quotes: "~" "~"},请问属性quotes是什么意思?"~" "~"又是什么意思?

html-css019

在css的一个规则中看到q:lang(no){quotes: "~" "~"},请问属性quotes是什么意思?"~" "~"又是什么意思?,第1张

:lang 伪类向带有指定 lang 属性的元素添加样式。:lang 伪类根据元素的语言编码匹配元素。这种语言信息必须包含在文档中,或者与文档关联,不能从 CSS 指定。:lang 的处理与 |= 选择器相同。 像问题中说的,就是匹配所有带有"lang=no"属性的"q“元素并给其定义"引号"的类型。

用来和 :after 及 :before

伪元素一起使用,在对象前或后显示内容。content:后可加的内容有下列几种

attr(alt)

: 

使用对象的 alt 属性的文字

counter(name)

: 

使用已命名的计数器

counter(name, list-style-type)

: 

使用已命名的计数器并遵从指定的 list-style-type

属性

counters(name, string)

: 

使用所有已命名的计数器

counters(name, string,

list-style-type)

: 

使用所有已命名的计数器并遵从指定的 list-style-type

属性

no-close-quote

: 

并不插入 quotes 属性的后标记。但增加其嵌套级别

no-open-quote

: 

并不插入 quotes 属性的前标记。但减少其嵌套级别

close-quote

: 

插入 quotes 属性的后标记

open-quote

: 

插入 quotes 属性的前标记

string

: 

使用用引号括起的字符串

url(url)

: 

使用指定的绝对或相对 url 地址

这个是after伪对象的应用,对应的还有before伪对象。用来和 content 属性一起使用,设置在对象后(依据对象树的逻辑结构)发生的内容。

IE是不兼容这个对象的。

下面是content的语法:content : attr(alt) | counter(name) | counter(name , list-style-type) | counters(name , string) | counters(name , string , list-style-type) | no-close-quote | no-open-quote | close-quote | open-quote | string | url(url)

取值:

attr(alt) : 使用对象的 alt 属性的文字

counter(name) : 使用已命名的计数器

counter(name, list-style-type) : 使用已命名的计数器并遵从指定的 list-style-type 属性

counters(name, string) : 使用所有已命名的计数器

counters(name, string, list-style-type) : 使用所有已命名的计数器并遵从指定的 list-style-type 属性

no-close-quote : 并不插入 quotes 属性的后标记。但增加其嵌套级别

no-open-quote : 并不插入 quotes 属性的前标记。但减少其嵌套级别

close-quote : 插入 quotes 属性的后标记

open-quote : 插入 quotes 属性的前标记

string : 使用用引号括起的字符串

url(url) : 使用指定的绝对或相对 url 地址