CSS Selector Level 4 » Default option pseudo-class

This pseudo-class is called the default option and it selects the default element among a set of the same elements. It would select the default item of a select list or a button which is its form default button for example.

This pseudo-class is also part of the CSS3UI specification.

Syntax

Copy
:default {
    /* declarations */
}

Example

Copy
:default {
    background-color: gray;
}

The mentioned example would set the background-color of a default element of a selection list/button group to gray.

Try example in CodePen

Browser support

Platform Chrome Firefox Safari Edge Internet Explorer Opera
Desktop Yes (6.0) Yes (4.0) Yes (5.1) No No Yes (12.1)
Mobile Yes (6.0) Yes (4.0) Yes (7.1) No No Yes (12.1)

Usage statistics (Alexa Top 1,250,000 sites)


Please wait a moment, the comments start loading now...
explorermozillachromesafariopera