content
作者:不详 来源: 【大 中 小】 浏览: 添加日期:2008-12-12 我要评论(0)
CSS content 属性
定义
content 属性与 :befor 及 :after 伪元素配合使用,来生成贴附于某个 CSS 选择器之前或之后的内容。
继承性:NO
说明
该属性用于定义元素之前或之后放置的生成内容。默认地,这往往是行内内容,不过该内容创建的框类型可以用属性 display 控制。
JavaScript 语法
CSS 属性也可通过一段 JavaScript 被动态地改变。
脚本语法:
object.style.content="url(beep.wav)"
例子
p:before{
content:url("beep.wav");
}
img:before{
content:attr(alt);
}
可能的值
| 值 | 描述 |
|---|---|
| string | 定义文本内容。默认值是""。 |
| url | 定义一个 URL (绝对 URI)。 |
| counter(name) counter(name,list-style-type) counters(name,string) counters(name,string,list-style-type) | |
| attr(X) | 定义可显示在某个选择器之前或之后的选择器属性。 |
| open-quote close-quote no-open-quote no-close-quote |
2008.10 made by colinivy && wondger
(如果您觉得本站不错,请告诉身边的朋友,或转载到论坛、百度知道、贴吧等,记得带网址哟,不胜感激!)
〖CSS手册〗Tags:
- 上一篇:CSS内容生成
- 下一篇:counter-increment
相关文章
更多评论(0)..会员评论
最新评论文章
推荐专题
在线交流QQ群
- 106310407(开)
- 55427134(开)
- 2993401(开)
- 33424604(开)
- 2993401(开)
- 161512108(开)
- 161510519(开)
- 158375021(开)
- 155858414(开)
- 143309878(开)
- 16373807(开)
- 129098721(开)
- 123473199(开)
- 146991009(开)
- 135792800(开)
- 78568516(开)
