From the course: Building Great Forms with HTML and CSS

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using pseudo-classes to be more specific

Using pseudo-classes to be more specific

From the course: Building Great Forms with HTML and CSS

Start my 1-month free trial

Using pseudo-classes to be more specific

- [Instructor] Pseudo-class is basically a phantom state, or specific characteristic of an element that can be targeted with CSS. A pseudo-class has information about the element that's in the document tree, but not available through any specified attribute. For example, you may be familiar with colon hover, which allows you to style the hover state of links and buttons. Or the colon first child pseudo-class, which applies to elements which are the first child of their parents. You can get that information from the DOM tree, but there's no specific attribute for either of those. Let's take a look at some pseudo-classes that are specific to form fields, and form field inputs. These pseudo-classes can be used to style fields based on the validity of user input, or whether the field is required, or it's currently enabled. We're going to look at several of these in an actual website. Let me switch back to my file. I have…

Contents