Basic CSS Selectors

Type, Class, and ID CSS Selectors

We'll cover the following

Basic three CSS selectors #

CSS rules can select for elements in many different ways. The three basic kinds of selectors are:

  1. type selectors: used to select HTML elements by element name
  2. class selectors: used to select HTML elements by a specific class value
  3. id selectors: used to select an HTML element associated with a specific id value

Using a type selector is as simple as typing the name of the element:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy