CSS content属性是什么?怎么用

如题所述

  用来和 :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 地址
温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-04-26
用来和 :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 地址本回答被提问者采纳
相似回答