What types of selectors are there in css?

青灯夜游
Release: 2023-01-06 11:12:37
Original
45816 people have browsed it

The types of css selectors are: 1. Element selector; 2. ID selector; 3. Class selector; 4. Group selector (union selector); 5. Composite selector (intersection Selector); 6. Wildcard selector; 7. Descendant element selector; 8. Child element selection; 9. Pseudo-class selector; 10. Attribute selector; 11. Sibling element selector.

What types of selectors are there in css?

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

What are the types of CSS selectors?

1. Element selectorTag name{}

2. id selector#id attribute value { }

##3. Class selector·class attribute value { }

4. Group selector (union selector)

Function: It can select multiple items at the same time Elements corresponding to selectors (usually used for collective declaration)

Syntax:

选择器1,选择器2,选择器n{ }
Copy after login

5. Compound selector (intersection selector)

Function: Select a more accurate and detailed target element and set attributes for it

Syntax:

选择器1选择器2选择器n{ }
Copy after login