Visit Mozilla.org

CSS::default

From MDC

« CSS Reference

This article covers features introduced in Firefox 3


[edit] Summary

The :default selector is used to identify a user interface element that is the default among a group of similar elements.

For example, the default button in a set of buttons would have this pseudo-class applied to it.

User interface elements that permit multiple selection may have multiple defaults set in order to initially appear with multiple items selected.

[edit] Syntax

:default { style properties }

[edit] 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.

[edit] Specification