Custom Radio Buttons with CSS

In this tutorial we will see how to make Custom Radio Buttons with CSS. Simple CSS is used for this purpose, HTML code and CSS code is given.

HTML Code

HTML Code is given below.

<form>
<input type="radio" id="lang-1" name="lang" value="HTML" class="radio" checked>
<label class="label label-1" for="lang-1">HTML</label>
    
<input type="radio" id="lang-2" name="lang" value="CSS" class="radio">
<label class="label label-2" for="lang-2">CSS</label>
    
<input type="radio" id="lang-3" name="lang" value="JavaScript" class="radio">
<label class="label label-3" for="lang-3">JavaScript</label>     
</form>    

CSS Code

CSS Code is given below.

<style>
body
{
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'Barlow Condensed',sans-serif;
    background-color: #B8EAFF;
}
.radio
{
    display: none;
}
.label
{
    padding: 5px 10px;
    background-color: #888;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
#lang-1:checked ~ .label-1,
#lang-2:checked ~ .label-2,
#lang-3:checked ~ .label-3
{
   background-color: #0069D9;   
}
</style>

Demo

Video Tutorial

Watch our video tutorial on Custom Radio Buttons with CSS.

Social Media Menu with Popup Tooltip using HTML and CSS Horizontal Navigation Menu with HTML and CSS Responsive Sidebar Menu with CSS and JavaScript Cool CSS Button with Hover Animation Pure CSS Custom Radio Buttons Custom Emoji Radio Buttons with CSS Color Picker Design with HTML CSS and JavaScript Custom Radio Buttons with CSS Engraved HTML Buttons With CSS Neumorphic Buttons Design with CSS Cool Profile Card Design with HTML CSS Neumorphic Search Bar Design with HTML and CSS Simple Login Form with Placeholder Animation Pure CSS Button with Folded Corner Background Color Change Slider with HTML CSS and JavaScript 404 Page Not Found Template Design with HTML and CSS Movies Blog Card Design with HTML and CSS Simple CSS Border Animation with before and after Selector Custom Social Select Dropdown Menu with CSS and JavaScript Facebook Offline and Online Notification with CSS and JS New Year 2022 Text Animation with CSS and JS Change Placeholder Color using CSS Custom Select Tag DropDown with CSS and JavaScript Simple Price Range Slider With HTML CSS and JavaScript Profile Card With Hover Effect using HTML and CSS Circle With Two Colors using CSS Simple FAQ Accordion With HTML CSS and JavaScript