当前位置: 首页 > 网络学院 > 网页制作基础教程 > CSS > CSS content属性

CSS
CSS 介绍
CSS 语法
使用 CSS
CSS 背景
CSS 文字
CSS 字体
CSS 边框
CSS 边距
CSS 填充
CSS 列表
CSS 尺寸
CSS 类别
CSS 定位
CSS 伪类
CSS 伪元素
CSS2 Media类型
CSS 摘要
CSS 实例
CSS2 参考资料
CSS2 打印

CSS content属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 362 ::
收藏到网摘: n/a

The content property is used with the :before and :after pseudo-elements to generate content to attach before or after a CSS selector.
content属性可通过:before 和 :after 这两个伪元素来给CSS选择器的前后生成附带内容。

Inherited: No
继承性:无

举例

p:before
{
content: url("beep.wav")
}

img:before
{
content: attr(alt)
}

可用值

描述
NN IE
string Defines text content
定义文字内容
   
url Defines a url
定义url资源
   
counter(name)
counter(name, list-style-type)
counters(name, string)
counters(name, string, list-style-type)
     
attr(X) Defines an attribute of a selector to be displayed before/after the selector
定义选择器前后的属性
   
open-quote      
close-quote      
no-open-quote      
no-close-quote      

评论 (0) All

登陆 | 还没注册?