Why are CSS selectors used in HTML?

Selectors are the basic concept for styling HTML elements. Selectors are used to specifying which HTML elements will receive which styles. There are different types of selectors such as class type, ID type, and, attributes type, etc

Different types of Selectors in CSS are as follows

  1. ID selectors

  2. Class selectors

  3. Universal selectors

  4. General sibling selectors

  5. Descendent selectors

  6. Adjacent sibling selectors