Join James Williamson for an in-depth discussion in this video Specifying attribute values, part of CSS: Selectors.
- In our last exercise, we covered…the basics of attribute selectors.…So in this one, let's take a closer look…at how to match specific attribute values.…And to do that, I'm gonna be working with…the attribute.htm file found in the 02_2 directory.…You can see that i have it opened up in our browser here.…And I just wanna point out a little bit of a difference…between the last file and this one,…in that our syntax section has changed to reflect…syntax for matching specific values…All right I'm gonna scroll down just a little bit…because I wanna go over this syntax in a little bit…more detail before we actually…get into the exercise itself.…
So the first example that you see here,…where it just says class="tip",…this is an exact match, so essentially here,…you're targeting a specific value for that attribute.…In this case, it would only match an element…that has a class attribute applied to it,…where the value of that is "tip", that's the only value.…Now, sometimes that's all you need.…But other times, like with class for example,…
- 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
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.