ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

选择器复习

2022-04-27 09:02:52  阅读:174  来源: 互联网

标签:box 复习 选择器 nth child class first



属性选择器?
[属性名]{}

[class]{}
[class ^= 'box-']{}
[class $= 'box']{}
[class *= 'box']{}
[class= 'box']{}


结构伪类选择器有哪些?
1. 第一个 :first-child body :first-child{} body p:first-child{}
2. 最后一个孩子 :last-child
3. 第几个 :nth-child(3){}
:nth-child(odd){}
:nth-child(even){}
:nth-child(-n+3){}
:nth-child(n+3){}
:nth-child(n+3):nth-child(-n+6)
4. 内容或元素为空的 body :empty{}
<div></div>
<div> </div>
<div><p></p></div>
<div>文字</div>
5. 元素为父元素唯一元素的
body :only-chil{}

<div>
<p></p>
</div>
<div>
<p></p>
<p></p>
</div>

伪类选择器?
:link{}
:visited{}
:hover{}
:active{}

:after{}
:before{}

<p>

</p>

作用于块元素
p::after{
content:"-";
display:block;
}
p::before{
content:"+";
}

foucs: 获得焦点(理解成点击)

input:focus{}
a:focus{}

<button>按钮</button>
<div></div>

button:foucs + div{}

:first-letter{}
:first-line{}


目标伪类选择器?
:target{

}

否定选择器?
:not(div)

 

UI状态选择器?
:disabled{}
:enabled{}
:checked{}


盒子阴影和文本阴影的语法分别是?
text-shadow: 3px 3px 4px grey;
右 下 模糊度

box-shadow:3px 3px 4px 4px grey inset;
右 下 模糊度 阴影大小

 

标签:box,复习,选择器,nth,child,class,first
来源: https://www.cnblogs.com/royaltyze/p/16197508.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有