The :default CSS pseudo-class represents any user interface element that is the default among a group of similar elements.
For example, the default button in a set of buttons could be selected using this pseudo-class.
User interface elements that permit multiple selections may have multiple defaults set in order to initially appear with multiple items selected. In that case all defaults can be represented using the :default pseudo-class.
Syntax
:default { style properties }
Examples
1
:default
2
{
3
background-color: lime;
4
}
…where…
1
<formmethod="get">
2
<p><inputtype="submit"id="submit1"></p>
3
<p><inputtype="submit"id="submit2"></p>
4
<p><inputtype="reset"></p>
5
</form>
This example causes the background color to be lime for the default submit button in the form.