How to organize CSS pseudo-classes or pseudo-element selectors
In this issue, the editor will bring you about how to organize CSS pseudo-classes or pseudo-element selectors. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
I. Hyperlink
A:link {color:red;}
A:visited {color:blue;}
A:hover {color:black;}
A:active {color:#6600CC;}
Note: the order of settings can not be changed, follow the principle of love/hate. -- this principle is written here when you read what other people say on the Internet.
Second, more pseudo-classes
: root-- the root of the document
: nth-child (n)-an element of the nth child whose parent element
: nth-last-child (n)-an element of the nth child whose parent element is, starting with the last one
: nth-of-type (n)-an element of the nth brother of its type
: nth-last-of-type (n)-an element of the nth brother of its type, starting from the last
: first-child-- an element of the first child whose parent element
: last-child-an element of the last child of its parent element
: first-of-type-an element as the first brother of its type
: last-of-type-an element of the first sibling of its type, starting with the last number
: only-child-an element of the only child whose parent element
: only-of-type-an element that is the only sibling of its type
: empty-- an element without children or text
3. Some pseudo elements
The first letter of first-letter
: after selects the back of the element, allowing content to be inserted in these locations
: before selects the front of the element, allowing content to be inserted in these locations
The above is the editor for you to share the CSS pseudo-class or pseudo-element selector how to sort out, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.