HTML and CSS Reference
In-Depth Information
The :checked and :indeterminate pseudo-
classes can only be applied to inputs of
type checkbox :
<label>Not checked
<input type="checkbox">
<input type="checkbox" checked>
As you might expect, :checked lets you
style all checked check boxes:
input:checked {
outline: 4px solid #000;
You might use this to replace the default
check box with a graphic.
The indeterminate state has to be set by a
input:indeterminate {
outline: 4px solid #000;
Note that :indeterminate is independent of
:checked —both checked and unchecked
check boxes can be in the indeterminate state.
You can also use CSS3 with the HTML5
form features, such as validity. Here are
one valid and one invalid form field:
<input type="url"
<input type="url"
value="Not a URL">
Search WWH ::

Custom Search