CSS ::highlight() Pseudo-element
- Προηγούμενη σελίδα ::grammar-error
- Επόμενη σελίδα ::marker
- Επιστροφή στο προηγούμενο επίπεδο Εκπαιδευτικός Οδηγός Πseudoελλειμμάτων CSS
Definition and Usage
CSS ::highlight()
Pseudo-elements are used to set the styles of custom highlighting.
Custom highlighting is a set of Range objects, registered on the web page through HighlightRegistry.
Note:The following properties can be used with ::highlight()
Use Together:
- color
- background-color
- text-decoration
- text-shadow
Example
Set four custom highlight styles:
::highlight(mycolor-1) { color: red; } ::highlight(mycolor-2) { color: green; } ::highlight(mycolor-3) { color: blue; } ::highlight(mycolor-4) { color: salmon; }
CSS Syntax
::highlight(custom-highlight-name) { css declarations; }
Technical Details
Version: | CSS Custom Highlight API Module Level 1 |
---|
Browser Support
The numbers in the table specify the first browser version that fully supports the pseudo-element.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
105 | 105 | 不支持 | 17.2 | 91 |
相关页面
Εκμάθηση:Ψευδοέлемент CSS
- Προηγούμενη σελίδα ::grammar-error
- Επόμενη σελίδα ::marker
- Επιστροφή στο προηγούμενο επίπεδο Εκπαιδευτικός Οδηγός Πseudoελλειμμάτων CSS