CSS :default Selector


Example

Add a red shadow color to the default input element:

input:default {
  box-shadow: 0 0 1px 1px red;
}
Try it Yourself »

Definition and Usage

The :default selector selects the default form element in a group of related elements.

The :default selector can only be used on <button>, <input type="checkbox">, <input type="radio">, and <option> elements

Version: CSS3

Browser Support

The numbers in the table specifies the first browser version that fully supports the selector.

Selector
:default 10.0 12.0 4.0 5.0 10.0

Note: The :default selector is not supported in Internet Explorer 11 and earlier versions.


CSS Syntax

:default {
  css declarations;
}

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.
5.0