The :optional CSS pseudo-class represents any <input>, <select>, or <textarea> element that does not have the required attribute set on it.
/* Selects any optional <input> */ input:optional { border: 1px dashed black; }
This pseudo-class is useful for styling fields that are not required to submit a form.
Note: The :required pseudo-class selects required form fields.