I. Pseudo Selector
Pseudo-selectors include: pseudo-class selectors and pseudo-object selectors, prefixed with a colon (:), followed by a pseudo-class or pseudo-object name, with no spaces before or after the colon, otherwise resolved to include selectors
Such as:
Div:hover { font-size:12px;} /* Div for the specified tag name hover selector, pseudo-class or pseudo-element name */
Pseudo-selectors are specifically designed to select elements or objects in special areas or in special states that are not precisely controlled by tag selectors, ID selectors, or class selectors.
Second, pseudo-class selectors and pseudo-object selectors
Pseudo class |
Description |
: Focus |
Defines the style of an object when it becomes the input focus (when the onfocus event of the object occurs) |
: First-child |
Defines the style of the first child object of an object |
: First |
Defines the style used on the first page of a shale container, only applicable to @page rules |
: Left |
Defines the style used by all pages on the left side of the gutter, only for @page rules |
: Right |
Defines the style used by all pages on the right side of the gutter, only for @page rules |
: lang |
Defines the content style of an object using a special language |
Pseudo-Object |
Description |
: After |
Used with the content property to define what is behind the object |
: Before |
Used with the content property to define what is in front of the object |
: First-letter |
Defines the style of the first character within an object |
: First-line |
Defines the style of the first row within an object |
Third, hyperlinks
@charset "Utf-8";/*CSS Document*//*hyperlink Default Style*/a{text-decoration:None;Color:#333333;}/*Styles visited*/a:visited{Color:#0000ff;}/*Mouse over style*/a:hover{Color:#00ff00;}/*Mouse down Style*/a:active{Color:#FF0000;
There is one more: Link can define a hyperlink style that has not been visited, and you can use a selector instead of the A:link selector style.
Link and: Visited called Link pseudo-class, can only be applied to anchor elements;
: Hover,:active and: Focus is called dynamic Pseudo-class and can theoretically be applied to any element.
CSS pseudo-class and Pseudo-object selection (V)