Forms have a specific group of CSS pseudo-classes that make styling easier. In this video, learn about the checked, required, optional, enabled, and disabled pseudo-classes, as well as their correct application.
- [Instructor] When working with forms, … there are some new pseudo-classes … that may help you greatly in your work. … With HTML5, we now have a new attribute … for any of these form tags, … which is the required attribute. … This attribute is a nice way of identifying … required elements via styling. … It's also particularly important for accessibility reasons, … so those using assistive technology … understand which fields are required. … Adding the required attribute … by itself does nothing at all. … In order to actually make the field required, … an error-checking script is needed … to be sure that the required fields are completed. … Alternatively, you could use the pattern attribute … in the tag combined with a regular expression … for pattern matching. … In our case, we're only concerned with the styling aspect … of this for that required field, … so let's go ahead and take a look at that as a example. … So it's the :required pseudo-class. … And so here we can just go ahead and say something …
- 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.