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

What is the syntax of selector in CSS3

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

Share

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

In this article Xiaobian for you to introduce in detail "what is the syntax of selector in CSS3", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "what is the syntax of selector in CSS3" can help you solve your doubts.

1, basic selector syntax

(1) * wildcard selector selects all HTML elements in the document

(2) E element selector selects HTML elements of the specified type

# id ID selector selects any type of element that specifies that the ID attribute value is "id"

The .class selector selects any number of elements of any type that specify the value of the class attribute as "class"

The selector1,selectorN group selector merges the set of elements matched by each selector.

2, hierarchical selector syntax

(1) the E F descendant selector (including selector) selects the matching F element, and the matched F element is contained in the matching E element.

(2) the E > F child selector selects the matching F element, and the matching F element matches the child elements of the E element.

(3) the matching F element is selected by the Eforth F neighboring sibling selector, and the matched F element is located immediately after the matching E element.

(4) the Ematches F universal selector selects matching F elements, and all matching F elements are located after the matching E elements.

3, dynamic pseudo-class selector syntax

(1) the E:link link pseudo-class selector selects the matching E element, and the matching element is defined and the hyperlink has not been accessed. Often used on link trace points

(2) the E:visited link pseudo class selector selects the matching E element, and the matching element is defined with a hyperlink and has been accessed. Often used on link trace points

(3) the E:active user behavior selector selects the matching E element, and the matching element is activated. Often used on link strokes and buttons

(4) the E:hover user behavior selector selects the matching E element, and the user mouse hovers over the element E. IE6 and below browsers only support a:hover

(5) the E:focus user behavior selector selects the matching E element, and the matching element gets the focus.

After reading this, the article "what is the syntax of selectors in CSS3" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, 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