日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > CSS >内容正文

CSS

CSS伪元素速查

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

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

總結(jié)

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

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。