本文摘自PHP中文网,作者青灯夜游,侵删。
css伪类:“:active”、“:any-link”、“:blank”、“:checked”、“:current”、“:first”、“:first-child”、“:future”、“:focus”、“:has()”、“:host”等。
本教程操作环境:windows7系统、CSS3版、Dell G3电脑。
伪类选择器(简称:伪类)通过冒号来定义,它定义了元素的状态,如点击按下,点击完成等,通过伪类可以为元素的状态修改样式。CSS伪类是用来添加一些选择器的特殊效果。
css中的伪类列表
:active | :any-link | :blank | :checked | :current | :default |
:defined | :dir() | :disabled | :drop | :empty | :enabled |
:first | :first-child | :first-of-type | :fullscreen | :future | :focus |
:focus-visible | :focus-within | :has() | :host | :host() | :host-context() |
:hover | :indeterminate | :in-range:invalid | :is() | :lang() | :last-child |
:last-of-type | :left | :link | :local-link | :not() | :nth-child() |
:nth-col() | :nth-last-child() | :nth-last-col() | :nth-last-of-type() | :nth-of-type() | :only-child |
:only-of-type | :optional | :out-of-range | :past | :placeholder-shown | :read-only |
:read-write | :required | :right | :root | :scope | :target |
:target-within | :user-invalid | :valid | :visited | :where() |
常用的伪类及其分类
相关阅读 >>
更多相关阅读请进入《css》频道 >>
Vue.js 设计与实现 基于Vue.js 3 深入解析Vue.js 设计细节
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者