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) Yes (4) Yes (5.1) Yes (79) No Yes (12.1)
Mobile Yes (6) Yes (4) Yes (7.1) Yes (79) No Yes (12.1)

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

Due to an extreme price increase of our statistics provider the data collection was stopped in September 2018.


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