What is a CSS selector?


#1

Question

What is a CSS selector?

Answer

CSS selectors are used to target HTML elements for styling. There are many different types of selectors, several of which were covered in the last lesson. If you have been going through this course sequentially, the selectors you have learned about thus far are:

  1. id selectors
  2. class selectors
  3. descendant selectors
  4. chained or qualified selectors

FAQ: Learn CSS – CSS Visual Rules – CSS Structure