CSS/Selektoren/optional
Aus SELFHTML-Wiki
CSS | Selektoren
Der :optional-Pseudoklassen-Selektor bezeichnet Eingabe-Elemente, die kein required besitzen
- Syntax
:optional {}
- anwendbar auf
Beispiel
*:optional {
background-color: palegreen;
}
Eingabefelder, die keine Pflichtfelder sind, werden hellgrün eingefärbt.
Siehe auch
Weblinks
- WHATWG: optional Selectors Level 4
- MDN: :optional
- Browser-Support: caniuse.com
CSS-Selektoren
- dynamische Pseudoklassen
- :active
- :any-link
- :autofill
- :buffering
- :checked
- :default
- :defined
- :disabled
- :enabled
- :focus
- :focus-visible
- :focus-within
- :future
- :has()
- :hover
- :in-range
- :indeterminate
- :invalid
- :is() (war: matches())
- :lang()
- :link
- :muted
- :not()
- :open
- :optional
- :out-of-range
- :picture-in-picture
- :placeholder-shown
- :popover-open
- :target
- :target-current
- :user-invalid
- :user-valid
- :valid
- :visited
- :where()
- einfache Selektoren
- Kombinatoren
- Pseudoelemente
- strukturelle Pseudoklassen