CSS :default pseudo-class
- Προηγούμενη σελίδα :checked
- Επόμενη σελίδα :defined
- Επιστροφή στο προηγούμενο επίπεδο Οδηγός Πseudo-classes CSS
Definition and usage
CSS :default
The pseudo-class is used to select the default form element from a set of related elements.
This pseudo-class can be used for <button>, <input type="checkbox">, <input type="radio">, and <option> elements.
Example
Example 1
Add red shadows to default input elements:
input:default { box-shadow: 0 0 2px 2px red; }
Example 2
Set different default styles for radio buttons, checkboxes, and options:
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; }
CSS syntax
:default { css declarations; }
Technical details
Version: | CSS3 |
---|
Browser support
The numbers in the table specify the first browser version that fully supports this pseudo-class.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
10 | 79 | 4 | 5 | 10 |
- Προηγούμενη σελίδα :checked
- Επόμενη σελίδα :defined
- Επιστροφή στο προηγούμενο επίπεδο Οδηγός Πseudo-classes CSS