CSS :default Pseudo-class
Example
Add a red shadow color to default input elements:
input:default {
box-shadow: 0 0 2px 2px red;
}
Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The CSS :default
pseudo-class selects the default form element in a group of related elements.
This pseudo-class can 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 pseudo-class.
Pseudo-class | |||||
---|---|---|---|---|---|
:default | 10 | 79 | 4 | 5 | 10 |
CSS Syntax
:default {
css declarations;
}
More Examples
Example
Style radio buttons, checkboxes, and options with different default styles:
input[type=radio]:default {
box-shadow: 0 0 5px 3px blue;
}
input[type=checkbox]:default {
box-shadow: 0 0 5px 3px maroon;
}
option:default {
color: blue;
background-color:
pink;
}
Try it Yourself »