Home > Web Front-end > CSS Tutorial > What are the css structured pseudo-class selectors?

What are the css structured pseudo-class selectors?

醉折花枝作酒筹
Release: 2021-07-15 10:37:51
Original
5959 people have browsed it

The selectors are: :root, :not, :only-child, :first-child, :last-child, :empty:target, :nth-child(n), nth-last-child( n), :nth-of-type(n), etc.

What are the css structured pseudo-class selectors?

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

:root selector: matches the document root element

What are the css structured pseudo-class selectors?

:not selector: you must first set styles to the substructure elements that need to be excluded by the structural element. EffectiveWhat are the css structured pseudo-class selectors?

Example:

What are the css structured pseudo-class selectors?

:only-child:

What are the css structured pseudo-class selectors?

first- child, :last-child:

What are the css structured pseudo-class selectors?

:nth-child(n), nth-last-child(n):

What are the css structured pseudo-class selectors?

:nth-of-type(n), nth-last-of-type(n):

What are the css structured pseudo-class selectors?

:nth-child(n) and :nth The difference of -of-type(n)

What are the css structured pseudo-class selectors?

7. :empty: The :empty selector is used to select all elements that have no child elements or whose text content is empty.

8. :target::target selector is used to specify the style for a certain target element in the page (the id of the element is used as a hyperlink in the page). The style set by the :target selector will only take effect after the user clicks a hyperlink in the page and jumps to the target element.

Recommended learning: css video tutorial

The above is the detailed content of What are the css structured pseudo-class selectors?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
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