From the course: CSS: Selectors

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Form control states: :indeterminate, :default, :checked

Form control states: :indeterminate, :default, :checked - CSS Tutorial

From the course: CSS: Selectors

Form control states: :indeterminate, :default, :checked

- [Instructor] Although they might not look like it, the form control states of indeterminate, checked, and default, go together. Let's look at how these select different elements on the page. First, let's start with checked because it's fairly straightforward. The checked pseudo-class indicates that something is checked as in the chosen radio button or the check box. Remember that here in our HTML, we have used the checked attribute to check our radio button and I've added an extra check box down here on the form. So we have one checkbox that is checked by default and a second check box that is not checked. So let us try that checked pseudo-class and see what happens. So if I say checked. And we'll style it up with an outline of two pixels, solid red, this is going to select our checked items that are here on the page. So that's going to select the checked radio button and the checked check box. And as you know, this is because we have this checked attribute set here. What happens if…

Contents