:default

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

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

Try it

label,
input[type="submit"] {
  display: block;
  margin-top: 1em;
}

input:default {
  border: none;
  outline: 2px solid deeppink;
}

How did you find out about us?

Please agree to our terms:

What this selector matches is defined in HTML Standard §4.16.3 Pseudo-classes — it may match the

Syntax

css
:default {
  /* ... */
}

Examples

HTML

html
Favorite season

CSS

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

input:default + label {
  color: coral;
}

Result

Specifications

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

Browser compatibility

See also