高宽比
aspect-ratio 检测浏览器的高宽比
decice-aspect-ratio检测设备的高宽比
像素比
device-pixel-ratio
dom选择器
- 类选择器 class selectors
.classname
- 类型选择器 type selectors
- 属性选择器 attribute selectors
- 标签选择器
- id选择器
#idname
- 通配符选择器 *
- 子元素选择器 >
- 后代选择器 加一个空格
- 相邻元素选择器 +
- 组选择器 多个元素之间使用 ,
伪选择器
pseudo-selectors
用于文档树之外的元素或信息
结构化伪类
:nth-child(n)
li:nth-child(2){
color:red;
} //取父元素中的内的第二个li元素
:nth-last-child(n)
从最后一个开始计算
:nth-of-type(n)
查询第n个元素
:root
根元素 html标签
:target
目标伪类
:enabled
:disabled
状态伪类
:checked
属性选择器
Attribute Selectors
扫描二维码关注公众号,回复:
1554565 查看本文章
<p ref = 'test' ></p>
p[ref~ = 'test ] {color:red;}