The :default pseudo-class applies to the one or more UI elements that are the default among a set of similar elements. The :default pseudo-class must match any element in one of the following categories:
<button> elements that are their form's default
button. A form element's default button is the first submit button in
tree order whose form owner is that form element.<input> elements whose type attribute is in the
Submit Button or Image Button state, and that are their form's default
button<input> elements to which the checked attribute
applies and that have a checked attribute<option> elements that have a selected
attributeThe first <button type="submit"> is the default element, and
should have red text.
.example1 button:default {
color: red;
}
The first <input type="submit"> is the default
element, and should have red text.
.example2 input:default {
color: red;
}
The first <input type="image"> is the default element,
and should have a red border.
.example3 input:default {
border: 2px solid red;
}
The first <input type="radio"> element that has a
checked attribute is the default element, and should be colored
red.
.example4 input:default + label {
color: red;
}
The first <input type="checkbox"> element that has a
checked attribute is the default element, and should be colored
red.
.example5 input:default + label {
color: red;
}
The first <option> element that has a
selected attribute is the default element, and should be
colored red.
Currently not supported in most modern browsers.
.example6 option:default {
color: red;
}