default pseudo-class
The default pseudo-class specifies
a style of one element from a group that
has a default type. These elements must
be inside the parent <form> tag.
Syntax
selector:default {
}
Example
An example of a default type is the
type attribute with the submit
value. Let's set one of these buttons
to have a blue background:
<form>
<p>
<label>Enter number</label>
<input type="number">
</p>
<p>
<input type="submit">
<input type="submit">
<input type="reset">
</p>
</form>
:default {
background-color: #C2DDFD;
}
:
See also
-
the
:fullscreenpseudo-class
that styles elements in full screen mode -
the
:in-rangepseudo-class
that sets a style to elements with a given range of values -
the
:invalidpseudo-class
that sets a style for the input into which an invalid value was entered -
the
:optionalpseudo-class
that sets a style for the input that does not have a required attribute -
the
:out-of-rangepseudo-class
that styles elements whose values are out of range -
the
:focus-withinpseudo-class
that styles the elements in focus