CSS Selectors

Applying CSS to Different Parts of HTML

1. The element selector targets elements based on their HTML tag name.

  1. Class selectors target elements based on the value of the class attribute.
  2. ID selectors target elements based on the value of the id attribute.
  3. Attribute selectors target elements based on their attributes and values.
  4. The universal selector targets all elements.