CSS3 content属性的学习_第1页
免费预览已结束,剩余10页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、css3 content属性的学习css属性【content】用来和:after及:before伪元素一起用法,在对象前或后显示内容。content的取值:normal:默认值。表现与none值相同none:不生成任何值。:插入标签属性值:用法指定的肯定或相对地址插入一个外部资源(图像,声频,视频或扫瞄器支持的其他任何资源):插入字符串counter(name):用法已命名的计数器counter(name,list-style-type):用法已命名的计数器并遵从指定的list-style-type属性counters(name,string):用法全部已命名的计数器counters(name

2、,string,list-style-type):用法全部已命名的计数器并遵从指定的list-style-type属性no-close-quote:并不插入quotes属性的后标志。但增强其嵌套级别no-open-quote:并不插入quotes属性的前标志。但削减其嵌套级别close-quote:插入quotes属性的后标志open-quote:插入quotes属性的前标志这里比较不好理解的取值就是:counter(name)这些;下面主要总结一下这块,最后会给出各个取值的demo,比如我有如下html结构:这个是a方案这个是a方案这个是a方案这个是a方案这个是a方案我要在每个li的后面加上

3、当前li【index】值:ul licounter-increment:index;ul li:aftercontent:'统计:'counter(index);display:block;line-height:35px;说明:count(name)这里的name,必需要提前指定好,否则全部的值都将是0;count(name,list-style-type)这里的list-style-type就是css中list-style-type属性的取值;下面给出完整democss content.string p:after margin-left: -16px;background

4、: fff;content: "支持"color: f00;.attr p:after content: attr(title);.url p:before content: url(display: block;.test ol margin: 16px 0;padding: 0;list-style: none;.counter1 li counter-increment: testname;.counter1 li:before content: counter(testname)":"color: f00;font

5、-family: georgia,serif,sans-serif;.counter2 li counter-increment: testname2;.counter2 li:before content: counter(testname2,lower-roman)":"color: f00;font-family: georgia,serif,sans-serif;.counter3 ol ol margin: 0 0 0 28px;.counter3 li padding: 2px 0;counter-increment: testname3;.co

6、unter3 li:before content: counter(testname3,float)":"color: f00;font-family: georgia,serif,sans-serif;.counter3 li li counter-increment: testname4;.counter3 li li:before content: counter(testname3,decimal)"."counter(testname4,decimal)":".counter3

7、 li li li counter-increment: testname5;.counter3 li li li:before content: counter(testname3,decimal)"."counter(testname4,decimal)"."counter(testname5,decimal)":"string:你的扫瞄器是否支持content属性:否attr:url():假如你看到我的头像则解释你目前用法的扫瞄器支持content属性counter(name):列表项

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论