CSS3 :required Selector
Select and style only if the <input> element has a "required" attribute:
Try it yourself »
Definition and Usage
The :required selector selects form elements which are required.
Form elements with a required attribute are defined as required.
Note: The :required selector only applies to the form elements: input, select and textarea.
Tip: Use the :optional selector to select form elements which are optional.
The numbers in the table specifies the first browser version that fully supports the selector.
CSS Selector :optional
Thank You For Helping Us!
Your message has been sent to W3Schools.