What are the new pseudo-classes in css3?

青灯夜游
Release: 2023-01-05 16:11:41
Original
6504 people have browsed it

css3 pseudo-classes: ":first-of-type", ":last-of-type", ":only-of-type", ":only-child", ":nth-child( 2)", ":enabled", ":disabled", ":checked".

What are the new pseudo-classes in css3?

The operating environment of this tutorial: Windows 7 system, CSS3 version, Dell G3 computer.

Some new pseudo-classes in css3:

  • ##:first-of-type

    :The first-of-type selector matches every element that is the first child of a specific type from its parent element.

  • :last-of-type

    :last-of-type selector matches the last child of a specific type that belongs to its parent element for each element of the element.

  • :only-of-type

    :only-of-type selector matches the only child element of a specific type that belongs to its parent element of each element.

  • :only-child

    :only-child selector matches every element that is the only child element of its parent element.

  • :nth-child(2)

    :nth-child(n) selector matches the Nth child element that belongs to its parent element , regardless of the type of element.

    n can be a number, keyword or formula.

  • :enabled and :disabled

    The disabled state of the form control.

  • :checked

    :checked The selector matches every checked input element (applies only to radio buttons or checkboxes).

(Learning video sharing:

css video tutorial)

The above is the detailed content of What are the new pseudo-classes in css3?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template