有你在真好 的个人博客
所有CSS伪类-元素
阅读:2180 添加日期:2021/3/30 17:51:30

:checked (选择所有选中的表单元素)如:input:checked ;

:disabled (选择所有禁用的表单元素)如:input:disabled ;

:empty (选择所有没有子元素的p元素)如:p:empty ;

:enabled (选择所有启用的表单元素)如:input:enabled ;

:first-of-type (选择每个父元素是p元素的第一个p子元素)如:p:first-of-type ;

:in-range (选择元素指定范围内的值)如:input:in-range ;

:invalid (选择所有无效的元素)如:input:invalid ;

:last-child (选择所有p元素的最后一个子元素)如:p:last-child ;

:last-of-type (选择每个p元素是其母元素的最后一个p元素)p:last-of-type ;

:not(selector) (选择所有p以外的元素):not(p) ;

:nth-child(n) (选择所有p元素的第二个子元素) p:nth-child(2) ;

:nth-last-child(n) (选择所有p元素倒数的第二个子元素) p:nth-last-child(2) ;

:nth-last-of-type(n) (选择所有p元素倒数的第二个为p的子元素) p:nth-last-of-type

(2) ;

:nth-of-type(n) (选择所有p元素第二个为p的子元素) p:nth-of-type(2) ;

:only-of-type (选择所有仅有一个子元素为p的元素) p:only-of-type ;

:only-child (选择所有仅有一个子元素的p元素) p:only-child ;

:optional (选择没有“required”的元素属性) input:optional ;

:out-of-range (选择指定范围以外的值的元素属性) input:out-of-range ;

:read-only (选择只读属性的元素属性) input:read-only ;

:read-write (选择没有只读属性的元素属性) input:raed-write ;

:require (选择有“required”属性指定的元素属性) input:required ;

:root (选择文档的根元素) root ;

:target (选择当前活动的#news元素(点击URL包含锚的名字)) #news:target ;

:valid (选择所有哦有效值的属性) input:valid ;

:link (选择所有为访问链接) a:link ;

:visited (选择所有访问过的链接) a:visited ;

:active (选择正在活动链接) a:active ;

:hover (把鼠标放在链接上的状态) a:hover ;

:focus (选择元素输入后具有焦点) input:focus ;

:first-letter (选择每个<p>元素的第一个字母) p:first-letter ;

:first-line (选择每个<p>元素的第一行) p:first-line ;

:first-child (选择器汽配属于任意元素的第一个子元素的<p>元素) p:first-child ;

:brfore (在每个<p>元素之前插入内容) p:before ;

:after (在每个<p>元素之后插入内容) p:after ;

:lang(language) (为<p>元素的lang属性选择一个开始值) p:lang(it) ;

所有CSS伪类/元素

每天都抬头看看天空,很美很静

ICP备案号:苏ICP备14035786号-1 苏公网安备 32050502001014号