CSS - Universal Selector

CSS Universal Selector

Universal selector is used to select or target all the element on the web page.

  • It is denoted by an asterisk (*).

Wildcards

Universal selector also belongs to the category of Wildcards. Wildcards selectors (*, ^, and $ ) are selector that can be used together with attributes of an element.

  • class* - Selects all elements with class attribute containing "class" anywhere

  • class^ - Selects all elements with class attribute starting with "class".
  • class$ - Selects all elements with class attribute ending with "class"
note
NOTE:

It is not advisable to use universal selector many times throughout while creating your website, since it selects every element on the web page.

ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT