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.
# 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
.
# 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)
For future browser support information, also check out caniuse.com (Default option pseudo-class).
# 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...