二、css选择器
1.通配符 *{}
2.标签 tag p{}
3.类 class .c1{}
4.id #div{}
5.群组 span,.c2{}
6.后代 .box p{}
7.直接子集 .box>p{}
8.相邻下一个兄弟 .c1+.c2{}
9.同级后的所有兄弟
伪类选择器
:link 默认链接
:visited 点击后
:hover 鼠标经过
:active 点击时
表单伪类选择器
input:focus{} 获取焦点
input:checked{} 被勾选后效果
input:enabled{}激活状态
input:diabled{}失活
nth伪类选择器
1.first-child(第一子集)
2.last-child(最后一个子集)
3.first-of-type(先类型后位置)
4.last-of-type(先类后位)
5.nth-child()第_个子元素
even 2n
odd 2n-1
n+3
6.nth-last-child(1)倒着第一个(先位后类)
7.nth-of-type(4)所有第4个
8.nth-last-of-type 倒数
9.not选择器(反选)
:not([class])
10.:empty 空白元素
11.:only-child{} 独生子
12.:only-of-type{} 类型唯一独生子
伪元素选择器
p::before{}//p标签之前
::after{}//p标签之后
::first-letter{}//第一个文本第一个字
::selection{}//文本被拖拽选择时