CSS3 --- 选择器

来源:互联网 发布:网络经济犯罪的特点有 编辑:程序博客网 时间:2024/06/05 11:06

1. 选择器概述:

使用选择器将样式与元素直接绑定,css3还可以利用正则表达式实现各种复杂的制定,减少代码量。
选择器中常用符号: “^” — 开头字符 “?” — 结尾字符 “*”—- 包含字符匹配

2. 选择器的分类:

属性选择器
四种
[attr = val] —— 属性为val的
[attr* = val] —— 包含val的属性,css3新加
[attr^ = val] —— 以val开头的属性,css3新加
[attr$ = val] —— 以val结尾的属性,css3新加
结构性伪类选择器
11种
root
not
empty
target
first-child
last-child
nth-child
nth-last-child
nth-of-type
nth-last-of-type
only-child
状态伪类选择器
17种
E:hover
E:active
E:focus
E:enabled
E:disabled
E:read-only
E:read-write
E:checked
E:default
E:indeterminate
E:selection
E:invalid
E:valid
E:required
E:optional
E:in-range
E:out-of-range
原创粉丝点击