New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css] 第5天 CSS3新增伪类有哪些并简要描述 #14
Comments
目标元素url种锚指向文档内某个具体的元素,这个被链接的元素就是目标元素 |
:not
:nth-child()
:first-child
:last-child
:disabled
:checked
:empty
:only-child |
CSS3 中规定伪类使用一个 CSS3 中新增的伪元素有以下这些:
|
|
我用的不太多,常用的:last-child,:first-child,取最后一个元素和第一个元素,如果排除他们就用:not(); |
first-of-type |
|
CSS3 中规定伪类使用一个 : 来表示;伪元素则使用 :: 来表示。 CSS3 中新增的伪类有以下这些: :first-child / :last-child 表示子元素结构关系的 |
你是不走错片场了 |
CSS3 中新增的伪元素有以下这些:
|
CSS 伪类 是添加到选择器的关键字,指定要选择的元素的特殊状态
|
:root -- 选择文档的根元素,等同于html元素 |
|
|
:nth-child(n) 选中父元素下的第n个子元素,n可以接受具体的数值,也可以是函数 |
:nth-child(n)和:nth-of-type(n) 这两个伪类可以使我们选择某个元素的第n个子元素或同类型元素,可用于实现页面布局或样式控制。 :not(selector) :not伪类可以用来排除某些元素,只选择不符合条件的元素。 :checked :checked可用于表单元素上,选择被选中的元素,常用于复选框和单选框上。 :target :target可以选择当前活动的锚点,使其具有特殊的样式特效。 :first-child和:last-child :first-child用于选择当前元素的第一个子元素,:last-child用于选择当前元素的最后一个子元素。 :before和:after伪类 :before和:after伪类可以在元素内容之前或之后插入内容。这些伪类通常用于添加一些特殊的视觉效果,如箭头,图标等等。使用时必须设置content属性,它可以包含纯文本或在before和after伪类内嵌套其他元素。 |
第5天 CSS3新增伪类有哪些并简要描述
The text was updated successfully, but these errors were encountered: