复盘-----CSS(cascading style sheets)2

二、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)所有第48.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{}//文本被拖拽选择时
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值