Multiple elements, classes, and IDs can be grouped into a single selector. In this video, learn about group selectors and the common mistakes made with group selectors.
- [Instructor] Finally, it's likely you're already familiar … with group selectors. … These are selectors that are separated by commas, … but with only one set of styles. … In this example we have an H1, an H2, and an H3 … listed here as our selector separated by commas. … This is read as for all H1s, H2s, or H3s … style in the following way. … Any one of these HTML elements will be styled … in the same way. … You can think of this as an or statement in programming. … The styles apply for all of these HTML elements. … Group selectors aren't limited to elements though. … You can mix the selector types as this example shows. … Here we're applying one set of styling … to a class and to an ID. … A common mistake made when working with group selectors … is to assume that the styling carries through … to other elements in the group. … Consider this example. … Here we have a selector where all unvisited links … descended from a class of warning have a certain style, … but what if we want to include visited links …
- 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.