Correct terms and words for sections and parts of selectors

后端 未结 3 1206
青春惊慌失措
青春惊慌失措 2020-12-01 21:34

What is the correct term for the sections of CSS selectors that are separated by commas?

    body.         


        
3条回答
  •  感动是毒
    2020-12-01 22:08

    The specification offers terminology for this:

    A selector is a chain of one or more sequences of simple selectors separated by combinators. One pseudo-element may be appended to the last sequence of simple selectors in a selector.

    A sequence of simple selectors is a chain of simple selectors that are not separated by a combinator. It always begins with a type selector or a universal selector. No other type selector or universal selector is allowed in the sequence.

    A simple selector is either a type selector, universal selector, attribute selector, class selector, ID selector, or pseudo-class.

    Combinators are: whitespace, "greater-than sign" (U+003E, >), "plus sign" (U+002B, +) and "tilde" (U+007E, ~). White space may appear between a combinator and the simple selectors around it. Only the characters "space" (U+0020), "tab" (U+0009), "line feed" (U+000A), "carriage return" (U+000D), and "form feed" (U+000C) can occur in whitespace. Other space-like characters, such as "em-space" (U+2003) and "ideographic space" (U+3000), are never part of whitespace.

    There are some small terminology differences between CSS 2 and 3

    the list of basic definitions (selector, group of selectors, simple selector, etc.) has been changed; in particular, what was referred to in CSS2 as a simple selector is now called a sequence of simple selectors, and the term "simple selector" is now used for the components of this sequence

提交回复
热议问题