CSS selector and css3 Selector
1. the selector has the following types:
1. ID selector # aaaa {}
2. class selector. aaaa {}
3. Attribute Selector
Simple: h1 [attribute name] {}
Specific: h1 [attribute name = ""] {}
Part 1: h1 [attribute name ~ = ""] {}
Start with: h1 [attribute name ^ = ""] {}
End: h1 [attribute name $ = ""] {}
Including: h1 [attribute name * = ""] {}
Specific: h1 [attribute name | = ""] {} (starting with the attribute value)
4. Descendant Selector
Basic: body h1 {}
Exact: h1> strong {}
Adjacent: h1 + p {} (the two elements must be adjacent and must have a common parent element)
5. Pseudo-class selector
: Pseudo class {}
Static
: Like (Hyperlink pointing to an unaccessed address)
: Visited (accessed address)
: First-child (select the first child element)
: Lang (language selection)
Dynamic
: Focus (elements with input focus currently)
: Hover)
: Active (User-activated element)
6. pseudo element Selector
Handwritten letter style: element: first-letter {} (it can only be applied to block-level elements such as tags or paragraphs, and cannot be used for intra-row elements such as hyperlinks)
First line style: element: firs-line {} (it can only be applied to block-level elements such as tags or paragraphs, and cannot be used for intra-row elements such as hyperlinks)
Before setting: element: before {content: "content"; style}
After setting: element: after {content: "content"; style}