:required and :optional

Back to the index.

See also the CSS3 User Interface spec.

There are several pseudo-classes that are used to style the various states of form elements. This page tests some of them.

Test sheet:

input:required {
	border: 1px solid #CB000F;
}

input:optional {
	border: 1px solid #00882D;
}