From the course: CSS: Selectors
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Form controls: :required and :optional; :enabled and :disabled - CSS Tutorial
From the course: CSS: Selectors
Form controls: :required and :optional; :enabled and :disabled
- When working with forms, there are some new pseudo-classes that may help you greatly in your work, including enabled and disabled, and required and optional. But before we start this, let's look at our HTML, always a good place to start. This is a form, as you can see here on the page. Let's just look at this HTML, because there's a number of things in here you may not be familiar with. We start our form, we have our heading, we have some paragraphs. We also have a paragraph here that note it has the attribute of contenteditable. This would allow you to edit this paragraph right there on the page. It's not going to save anywhere, but you can, in fact, edit this text on the page. I'm going to show you how that works in a later video in this chapter. Then we're going to have a series of rows. These rows are for styling purposes. We have labels associated with those, this is for accessibility purposes. And we have an input field here that has, first of all, this is a type of text, so…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Form controls: :required and :optional; :enabled and :disabled5m 55s
-
(Locked)
Form controls: :read-only and :read-write5m 57s
-
(Locked)
Form control states: :indeterminate, :default, :checked6m 41s
-
(Locked)
Text fields: :autofill, :placeholder-shown7m 2s
-
(Locked)
Error checking: :valid, :invalid, :in-range, :out-of-range8m 15s
-
(Locked)
-
-
-