CSS optional Selector (original) (raw)
Last Updated : 11 Jul, 2025
The****: optional** selector in CSS is used to select and style the form input elements which are optional. That is it can select those input elements from an HTML form that are not declared as "required".
**Syntax:
:optional {
/* css declarations; */
}
**Example:
HTML `
optional Selector