码迷,mamicode.com
首页 > Web开发 > 详细

css样式表中四种属性选择器

时间:2015-12-30 09:11:50      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:

css样式表中四种属性选择器
1> 简易属性

tag[class]{ font-weight:bold }
It will affect all tag with any class.
e.g. <h2 class="old" > or <h2 class="new">

2>精确属性值

a[href="http://www.cnblogs.cn"][title="textTitle"]{font-size:10%} 
It will affect <a href="http://www.cnblogs.cn"title="textTitle">

3>部分属性值
类似使用perl中得匹配

p[class~="urgent"] {font-weight:bold;}
input [type="checkbox"],
input [type="radio"],
input [type="file"]
footer[role="contentinfo"] a

4>统配属性

*[lang|="en"]{color:white;}

 匹配连接lang或="en"字符的所有内容

css样式表中四种属性选择器

标签:

原文地址:http://www.cnblogs.com/shouce/p/5087658.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!