YouTip LogoYouTip

Sel Optional

## CSS :optional Selector The `:optional` selector selects form elements that are not required. **Note:** The `:optional` selector matches form elements that do not have the `required` attribute. ### Browser Support The numbers in the table specify the first browser version that fully supports the selector. | Selector | Chrome | Edge | Firefox | Safari | Opera | | :--- | :--- | :--- | :--- | :--- | :--- | | :optional | 10.0 | 12.0 | 4.0 | 5.1 | 10.0 | ### CSS Syntax ```css :optional { css declarations; } ### Example Select all `` elements that are not required: ```css input:optional { background-color: yellow; } [HTML DOM reference: :optional](#)
← Sel ValidSel Required β†’