您的位置:首页 > Web前端 > CSS

CSS2 样式表(属性·内容)

2012-03-09 00:00 316 查看
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) ":" }
$(document).ready(function(){dp.SyntaxHighlighter.HighlightAll('code');});

原文链接:
http://blog.csdn.net/vince6799/article/details/1842016
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: