Basic CSS Selectors

Get an understanding of three types of CSS selectors: type, class, and ID selector.

Basic three CSS selectors

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

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

The type selector

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