Join James Williamson for an in-depth discussion in this video Challenge: Writing efficient selectors, part of CSS: Selectors.
- View Offline
- Exercise Files
- We'll finish our chapter on writing efficient selectors…with a challenge that allows you…to put what you've learned into practice.…Now, although I've created specific steps to the challenge,…the strategies behind writing efficient selectors…really depend upon many different factors.…So feel free to experiment and organize the selectors…in a way that best represents your own personal strategy.…Now, we're gonna be working with two files…for this exercise, and that is the efficient.htm file…that you're seeing here in the browser…and the styles.css that's found…in the _css directory in the same folder, 0704.…
Okay, so essentially what we have here is a sample page…that has some advice…about using inheritance, grouping styles when possible,…reducing depth, some modulizing of classes,…some CSS resources,…and then a nice quote here from Benjamin Pulain,…who is a WebKit engineer.…It gives some great advice…when he's talking about writing selectors…based on performance, where he says,…"It's practically impossible to predict…
- Targeting classes and IDs
- Working with group selectors
- Targeting element attributes
- String matching
- Targeting links with pseudo-class selectors
- Targeting child elements and empty elements
- Targeting parent, child, and sibling elements
- Matching patterns
- Writing efficient selectors
Skill Level Intermediate
CSS: Advanced Typographic Techniqueswith James Williamson3h 14m Intermediate
HTML5: Graphics and Animation with Canvaswith Joe Marini3h 7m Intermediate
1. Basic Selectors
2. Attribute Selectors
3. User Action Pseudo-Class Selectors
4. Structural Selectors
6. Matching Patterns
7. Writing Efficient 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.