How To create Custom Checkbox and Radio Button Using Pure CSS

In this blog we are going to explain how to create custom checkbox and radio button using CSS. I have write CSS and HTML code separately, You can easily understand complete code. This blog is very useful for developers. radio-checkbox-button

CSS :-

  1. **/*Radio button*/
  2. .radio, .checkbox{display: inline-block;}
  3. .radio { padding:5px; margin-left:40px; }
  4. .radio input[type=”radio”] { opacity: 0; position: absolute; cursor:pointer;}
  5. .radio input[type=”radio”] + label { color:#555; line-height:25px; display:inline-block; text-indent:-38px; }
  6. .radio input[type=”radio”]:checked + label > mark:before { content:’ ‘; background:#0d7fbe; width:12px; height:12px; display:inline-block; margin:4px; border-radius:20px;}
  7. ……

 

HTML : –

  1. class=“radio”>
  2. type=“radio” name=“id” id=“id_0” value=“x”>
  3. for=“id_0”> Yes

  • <div class=“radio”>
  • ……
  • Read full blog at our highly specific C, Java, PHP, Javascript, iPhone, android developer forum about the topic described above How To create Custom Checkbox and Radio Button Using Pure CSS. You can also learn much more about different programming technologies and can enhance your tech skills.

    Advertisements