VOOZH about

URL: https://www.geeksforgeeks.org/web-templates/how-to-create-custom-radio-button-using-html-and-css/

⇱ How to Create Custom Radio Button using HTML and CSS ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Create Custom Radio Button using HTML and CSS ?

Last Updated : 12 Jul, 2025

The simple radio button can be customized using HTML and CSS easily. We will use some CSS properties to create a custom radio button. The :after pseudo-element and checked attribute is used to set some CSS property. The complete code is divided into two sections, the first section contains the HTML code and the second section contains the CSS code to create a custom radio button.
HTML Code: In this section, we will create a simple radio button using the <label> and <input> tags.
 

CSS Code: In this section, we will design the radio button using the :after pseudo element and checked attribute.
 

Complete Code: In this section, we will combine the above two sections (HTML and CSS) code to create a custom radio button.
 

Output: 
 

👁 Image


 

Comment