E2{}" format to select all specified child elements of the specified element; 2. Use the "element1 > *{}" format to select the specified element. All child elements of the element.">
You can use sub-selectors in CSS to select all sub-elements of a specified element: 1. Use the "E1 > E2{}" format to select all specified sub-elements of the specified element; 2. Use "element1 > ; *{}" format selects all child elements of the specified element.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
When an element is a child element of an element, you can use child selector matching, which selects all child elements of a specific parent. A child selector consists of two or more selectors separated by ">"; it is also called anelement > element
selector.
Note: The sub-selector can only select its own sub-category and second-level elements, but cannot select elements below the second level.
If you select all specified child elements of the specified element, use the following syntax
element1 > element2
Example:
选择所有指定子元素 段落 1
段落 2
段落 3段落 4段落 6
段落 7
Rendering:
[Recommended tutorial:CSS video tutorial]
If you want to recursively select all child elements, use the following syntax
element1 > * { // CSS样式 }
Example:
选择所有子元素 段落 1
段落 2
段落 3段落 4段落 6
段落 7
Rendering:
For more programming related knowledge, please visit:programmingvideo! !
The above is the detailed content of How to select all child elements in css. For more information, please follow other related articles on the PHP Chinese website!