Selectors in CSS target different parts of HTML. In this video, learn how to write CSS selectors that target HTML elements, 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. …
- Targeting classes and IDs
- Working with group selectors
- Targeting element attributes
- Targeting links with pseudo-class selectors
- Targeting child elements and empty elements
- Targeting parent, child, and sibling elements
- Best practices for CSS
- The impact of CSS selectors on performance
Skill Level Intermediate
The power of selectors1m 8s
1. Review of Basic CSS
2. Combinator Selectors
3. Attribute Selectors
Simple attribute selectors2m 47s
4. Pseudo-Classes, Pseudo-Elements, and the Universal Selector
5. Choosing Selectors
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.