What is universal selector?

What is universal selector?

A universal selector is a type of CSS Attribute Selectors, which allows one to search for and select a single element of any type. The universal selector for CSS is an asterisk (*).

It can be implied if it isn’t the only component of the simple selector. Hence, if it is implied, it can be omitted, as both instance will yield the same results.

For example: *.warning and .warning are considered equal and will have the same effect.

It is possible to confuse the universal selector with a wildcard character, however, the universal selector doesn’t match “zero or more elements.” Hence, this confusion should be avoided.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.