default property CSS Reference



Definition and Usage

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

:default
{
    background-color: lime;
}
...where...
 <form method="get">
  <p><input type="submit" id="submit1"></p>
  <p><input type="submit" id="submit2"></p>
  <p><input type="reset"></p>
 </form>
This example causes the background color to be lime for the default submit button in the form.

Compatibility

Desktop browsers

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support10.04.0 (2.0)Not supported10.05.0

Mobile browsers

FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic supportNA4.0 (2.0)Not supported10.05.0

Relative articles