VOOZH about

URL: https://www.geeksforgeeks.org/css/pure-css-required-inputs/

⇱ Pure.CSS Required Inputs - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Pure.CSS Required Inputs

Last Updated : 23 Jul, 2025

In some cases when we ask someone to fill a form and few things are optional and few things are a must to fill in that form.

In that case,  we can use the HTML required in Pure CSS as well.  This attribute works with other types of input like radio, checkbox, number, text, etc.

Syntax:

<input required> 

Example 1: In this example, we will use the required attribute on the text input type.

 


Output:

👁 Image

Example 2:  In this example, we will use the required attribute on the radio input type.

Output:

👁 Image
Comment