第5天 CSS3新增伪类有哪些并简要描述
Activity
[-][css] [第5天 CSS3新增伪类有哪些并简要描述][/-][+][css] 第5天 CSS3新增伪类有哪些并简要描述[/+]tiyunchen commentedon May 28, 2019
abin-jb commentedon Jun 14, 2019
目标元素
url种锚指向文档内某个具体的元素,这个被链接的元素就是目标元素
poporeki commentedon Jul 4, 2019
Konata9 commentedon Jul 21, 2019
CSS3 中规定伪类使用一个
:
来表示;伪元素则使用::
来表示。CSS3 中新增的伪元素有以下这些:
:first-child / :last-child
表示子元素结构关系的:nth-child() / nth-last-child()
用来控制奇数、偶数行的(控制表单奇数、偶数行的样式):first-of-type / :last-of-type
表示一组兄弟元素中其类型的第一个元素 MDN:nth-of-type() / :nth-last-of-type()
这个选择器匹配那些在相同兄弟节点中的位置与模式 an+b 匹配的相同元素` MDN:root
html 根元素:not()
否定选择器,用的比较多:only-child
只有一个子元素时才会生效:empty
选择连空格都没有的元素x011223 commentedon Aug 14, 2019
weizhanzhan commentedon Sep 20, 2019
我用的不太多,常用的:last-child,:first-child,取最后一个元素和第一个元素,如果排除他们就用:not();
奇数列:nth-child(2n+1),偶数列:nth-child(2n);上面好多没用过的哈哈 学习了
blueRoach commentedon May 19, 2020
first-of-type
last-of-type
only-of-type
only-child
nth-child()
nth-last-child()
nth-of-type()
nth-last-of-type()
last-child
empty
target
not
enabled
disabled
cheked
giggleCYT commentedon May 29, 2020
:first-of-type
选择属于其父元素的首个指定元素的每个指定元素。:last-of-type
选择属于其父元素的最后指定元素的每个指定元素。:only-of-type
选择属于其父元素唯一的指定元素的每个指定元素。:only-child
选择属于其父元素的唯一子元素的每个指定元素。:nth-child(2)
选择属于其父元素的第二个子元素的每个指定元素。:enabled
、:disabled
控制表单控件的禁用状态。:checked
单选框或复选框被选中。smile-2008 commentedon Aug 29, 2020
CSS3 中规定伪类使用一个 : 来表示;伪元素则使用 :: 来表示。
CSS3 中新增的伪类有以下这些:
:first-child / :last-child 表示子元素结构关系的
:nth-child() / nth-last-child() 用来控制奇数、偶数行的(控制表单奇数、偶数行的样式)
:first-of-type / :last-of-type 表示一组兄弟元素中其类型的第一个元素 MDN
:nth-of-type() / :nth-last-of-type() 这个选择器匹配那些在相同兄弟节点中的位置与模式 an+b 匹配的相同元素` MDN
:root html 根元素
:not() 否定选择器,用的比较多
:only-child 只有一个子元素时才会生效
:empty 选择连空格都没有的元素
pangyutong commentedon Mar 22, 2021
你是不走错片场了
mono2048 commentedon May 21, 2021
CSS3 中新增的伪元素有以下这些:
amikly commentedon Oct 23, 2021
CSS 伪类 是添加到选择器的关键字,指定要选择的元素的特殊状态
:nth-child
基本一致, 但它是从结尾计数, 而不是从开始计数6 remaining items