CSS :defined Pseudo-class
- Προηγούμενη σελίδα :default
- Επόμενη σελίδα :dir()
- Επιστροφή στο προηγούμενο επίπεδο Εγχειρίδιο Αναφορών Πseudo-classes CSS
Definition and Usage
CSS :defined
Pseudo-class is used to match any defined element.
This pseudo-class can be used for standard elements and custom elements that have been successfully defined.
Example
Usage :defined
Pseudo-class:
custom-element:not(:defined) { border-color: grey; color: grey; } custom-element:defined { background-color: salmon; border-color: maroon; color: black; } /* Display loading message */ custom-element:not(:defined)::before { content: "Loading..."; position: absolute; inset: 0 0 0 0; align-content: center; text-align: center; font-size: 25px; background-color: white; } /* Remove loading message */ custom-element:defined::before { content: ""; }
CSS Syntax
:defined { css declarations; }
Technical Details
Version: | CSS4 |
---|
Browser Support
The numbers in the table specify the first browser version to fully support this pseudo-class.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
54 | 79 | 63 | 10 | 41 |
- Προηγούμενη σελίδα :default
- Επόμενη σελίδα :dir()
- Επιστροφή στο προηγούμενο επίπεδο Εγχειρίδιο Αναφορών Πseudo-classes CSS