1.属性选择器
实际用处并不大的^,$,*,分别代表开头,结尾,包含。
简单例子:
a[class^="column"]{background:red;}
a[href$=".doc"]{background:green;}
a[title*="box"]{background:blue;}
分别代表:包含column 开头的类名,包含.doc 结尾的href属性,包含box的title属性。
2.伪类选择器
常见的伪类选择器:
1.类型1:not,:root,:empty,:target(值得注意)
#brand:target {
background: orange;
color: #fff;
}简单例子,这里选择器选择的就是id为brand的对象。开始不是出于出发状态,点击出发条件即#brand后触发。
2.类型2:first-child,last-child,nth-child(n),nth-last-child(n) 这类简单,基本就是一些匹配条件。
3.伪元素
enabled,disabled,checked,selection,read-only,read-write,before,after。
