选择器等的分类以及各种选择器的作用及属性:
主要有五种选择器:核心选择器 层次选择器 属性选择器 伪类选择器 伪元素选择器
1.核心选择器可以分为:
标签选择器
id选择器
类选择器
逗号选择器
组合选择器
普遍选择器
2.层次选择器主要分为:
子元素选择器
后代选择器
兄弟选择器
3.属性选择器又称为过滤器
在已有选择器的基础上进行筛选
selector[]
input[type]
input[type=text]
input[type^=s]
input[type$=t]
input[type*=t]
4.伪类选择器
表示结构的
:first-child
:last-child
:nth-child()
number/2n+1/even、odd
表示状态的
:link
:hover
:active
:visited
:focus
5.伪元素选择器
selector::after
将一个伪元素添加到selector选择到的元素里面的最后面
::hover
::before
::after
::first-letter
::first-line
::selection
选择器
最新推荐文章于 2020-08-06 17:54:47 发布