:default

The :default CSS pseudo-class selects form elements that are the default in a group of related elements.

Try it

What this selector matches is defined in HTML Standard §4.16.3 Pseudo-classes — it may match the <button>, <input type="checkbox">, <input type="radio">, and <option> elements:

Syntax

:default

Examples

HTML

<fieldset>
  <legend>Favorite season</legend>

  <input type="radio" name="season" id="spring">
  <label for="spring">Spring</label>

  <input type="radio" name="season" id="summer" checked>
  <label for="summer">Summer</label>

  <input type="radio" name="season" id="fall">
  <label for="fall">Fall</label>

  <input type="radio" name="season" id="winter">
  <label for="winter">Winter</label>
</fieldset>

CSS

input:default {
  box-shadow: 0 0 2px 1px coral;
}

input:default + label {
  color: coral;
}

Result

Specifications

Specification
HTML Standard
# selector-default
Selectors Level 4
# default-pseudo

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
:default
10
79
4
No
10
5
37
18
4
10.1
5
1.0

See also

https://developer.mozilla.org/en-US/docs/Web/CSS/:default