CSS2 样式表(属性·内容)

1、include-source
 

语法:
include-source : url ( url )
取值:
url ( url ) : 使用绝对或相对 url 地址指定插入文档。假如该文档不存在,当前对象的内容将被显示

说明:
这个属性插入另一个文档到当前文档,取代当前对象的内容。插入文档的样式属性从当前对象继承。
对应的脚本特性为 includeSource 。

示例:

div { position: absolute; top: 100px; left: 300px; width: 200px; height: 200px; border: thin solid black; include-source: url("http://www.dhtmlet.com/dream.html"); }

2、quotes
 

语法:
quotes : none | string
取值:
none : 默认值。 content 属性的 open-quote 和 close-quote 值将不会生成任何嵌套标记
string : 用引号括起的嵌套标记定义。两个为一组。第一个 string 定义前标记(例:"<"),第二个 string 定义后标记(例:">")。组之间用空格格开。嵌套标记的应用深度按定义顺序内推

说明:
设置或检索对象内使用的嵌套标记。
对应的脚本特性为 quotes 。

示例:

blockquote[lang-=fr] { quotes: "/201C" "/201D" }
blockquote[lang-=en] { quotes: "/00AB" "/00BB" }
blockquote:before { content: open-quote }
blockquote:after { content: close-quote }
?
q { quotes: """ """ "'" "'"; }
?
<q>This is an <q>emedded</q> quote.</q>
?
显示结果如下:
?
"This is an 'embedded' quote."

 

3、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 地址

说明:
用来和 :after 及 :before 伪元素一起使用,在对象前或后显示内容。
对应的脚本特性为 content 。


示例:

p:after { content: url("http:www.devguru.com"); text-decoration: none; }
p:before { content: url("beep.wav") }

4、counter-increment
 

语法:
counter-increment : none | identifier number
取值:
none : 默认值。阻止计数器增加
identifier number : identifier 定义一个将被增加计数的选择符(selector),id,或者class。 number 定义增加的数值。可以为负值。默认值是 1

说明:
设定当一个选择符(selector)发生时计数器增加的值。
对应的脚本特性为 counterIncrement



示例:

p:before { content: "paragraph" counter(paragraph); counter-increment: paragraph; }

5、counter-reset
 

语法:
counter-reset : none | identifier number
取值:
none : 默认值。阻止计数器复位
identifier number : identifier 定义一个将被复位的选择符(selector),id,或者class。 number 定义复位的数值。可以为负值。默认值是 0

说明:
将指定选择符(selector)的计数器复位。
对应的脚本特性为 counterReset 。


示例:

h1:before { counter-increment: main-heading; counter-reset: sub-heading; content: "Section " counter(main-heading) ":" }

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值