From the course: CSS: Selectors

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Type selectors, classes, and IDs

Type selectors, classes, and IDs - CSS Tutorial

From the course: CSS: Selectors

Start my 1-month free trial

Type selectors, classes, and IDs

- [Instructor] You're already familiar with a few kinds of selectors as you join this course. You've encountered elements, classes, and IDs before. Let's quickly review each type of selector and its use. The element selector means that our selector is some type of HTML element. Paragraphs, articles, sections, footers, headers, headings, lists, links, and so much more. We simply type in the name of the element and that is the selector for it. Element selectors are the least specific in the CSS cascade. That makes elements a great choice for writing generic code that should govern the style for most of your webpage, using other selectors to override these default values. A class is a style that can be used in many different cases on the same webpage. It's more specific than an element, meaning that it can override an element styling easily. Classes always start with a period in your style sheet and they are called via the attribute of class in your HTML. An ID is a style that can be…

Contents