CSS :optional Selector
Select and style only if the <input> element does not have a "required" attribute:
Definition and Usage
:optional selector selects form elements which are optional.
Form elements with no required attribute are defined as optional.
Note: The :optional selector only applies to the form elements: input, select and textarea.
Tip: Use the :required selector to select form elements which are required.
The numbers in the table specifies the first browser version that fully supports the selector.
CSS Selector :required