Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to organize CSS pseudo-classes or pseudo-element selectors

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report