The CSS universal selector selects everything. In this video, learn how to leverage the * star selector to prevent the over selection of elements.
- [Instructor] Finally, neither a pseudo class … nor a pseudo element, we have the universal selector. … It's designated by a star. … And as that star suggests, it's going to select everything … matching a certain criteria. … So, one of the things that I have done through the years … is I've often set up the body tag here … with some default styling for the document. … Like a font family or a font size, those kinds of things. … One of the things you might be tempted to do immediately … is to change your body tag to the star selector. … And boom, absolutely nothing changes here … in the way this webpage looks. … It has simply selected everything in the document … and applied those font families. … So what would be the difference … between using the body tag and using the star tag? … Well the problem is, you're using the wrong declaration here … for testing the star value. … So the difference is, in the case of the body tag, … everything is inheriting that font family. … But in the case of the star, …
- 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.