日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

CSS伪元素速查

發布時間:2025/6/17 56 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CSS伪元素速查 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

CSS偽元素

All CSS Pseudo Elements:

SelectorExampleExample description
::afterp::afterInsert something after the content of each element
::beforep::beforeInsert something before the content of each element
::first-letterp::first-letterSelects the first letter of each element
::first-linep::first-lineSelects the first line of each element
::selectionp::selectionSelects the portion of an element that is selected by a user

All CSS Pseudo Classes:

SelectorExampleExample description
:activea:activeSelects the active link
:checkedinput:checkedSelects every checked element
:disabledinput:disabledSelects every disabled element
:emptyp:emptySelects every element that has no children
:enabledinput:enabledSelects every enabled element
:first-childp:first-childSelects every elements that is the first child of its parent
:first-of-typep:first-of-typeSelects every element that is the first element of its parent
:focusinput:focusSelects the element that has focus
:hovera:hoverSelects links on mouse over
:in-rangeinput:in-rangeSelects elements with a value within a specified range
:invalidinput:invalidSelects all elements with an invalid value
:lang(language)p:lang(it)Selects every element with a lang attribute value starting with “it”
:last-childp:last-childSelects every elements that is the last child of its parent
:last-of-typep:last-of-typeSelects every element that is the last element of its parent
:linka:linkSelects all unvisited links
:not(selector):not( p)Selects every element that is not a element
:nth-child(n)p:nth-child(2)Selects every element that is the second child of its parent
:nth-last-child(n)p:nth-last-child(2)Selects every element that is the second child of its parent, counting from the last child
:nth-last-of-type(n)p:nth-last-of-type(2)Selects every element that is the second element of its parent, counting from the last child
:nth-of-type(n)p:nth-of-type(2)Selects every element that is the second element of its parent
:only-of-typep:only-of-typeSelects every element that is the only element of its parent
:only-childp:only-childSelects every element that is the only child of its parent
:optionalinput:optionalSelects elements with no “required” attribute
:out-of-rangeinput:out-of-rangeSelects elements with a value outside a specified range
:read-onlyinput:read-onlySelects elements with a “readonly” attribute specified
:read-writeinput:read-writeSelects elements with no “readonly” attribute
:requiredinput:requiredSelects elements with a “required” attribute specified
:rootrootSelects the document’s root element
:target#news:targetSelects the current active #news element (clicked on a URL containing that anchor name)
:validinput:validSelects all elements with a valid value
:visiteda:visitedSelects all visited links

總結

以上是生活随笔為你收集整理的CSS伪元素速查的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。