Skip to content
Related Articles

Related Articles

CSS | :default Selector

View Discussion
Improve Article
Save Article
  • Last Updated : 23 Aug, 2022
View Discussion
Improve Article
Save Article

The :default selector is used to set a default element in a group of same type of element in a form. This selector is used on button, option, radio button and check-box. 


:default {



<!DOCTYPE html>
        input[type="checkbox"]:default {
            box-shadow: 0 0 1px 1px gray;
    <h3>Select Language</h3>
    <form action="">
        <input type="checkbox" name="lan" value="c" checked> C
        <input type="checkbox" name="lan" value="c++"> C++
        <input type="checkbox" name="lan" value="java"> Java
        <input type="checkbox" name="lan" value="c#"> C#
        <input type="checkbox" name="lan" value="python"> Python
        <input type="checkbox" name="lan" value="javascript"> JavaScript



Supported Browsers:

  • Google Chrome 10.0
  • Edge 79.0
  • Firefox 4.0
  • Safari 5.0
  • Opera 10.0
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!