suffix
Baseline
2023
Newly available
Since September 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Der suffix Deskriptor der @counter-style Regel spezifiziert Inhalt, der am Ende der Markierungsdarstellung hinzugefügt wird.
Syntax
css
/* <symbol> value: string, image, or identifier */
suffix: "";
suffix: ") ";
suffix: url("bullet.png");
Werte
Der suffix Deskriptor nimmt als seinen Wert ein einzelnes <symbol>:
<symbol>-
Spezifiziert ein
<symbol>, das an die Markierungsdarstellung angehängt wird. Es kann ein<string>,<image>, oder<custom-ident>sein.
Formale Definition
| Zugehörige @-Regel | @counter-style |
|---|---|
| Anfangswert | ". " (full stop followed by a space) |
| Berechneter Wert | wie angegeben |
Formale Syntax
suffix =
<symbol>
<symbol> =
<string> |
<image> |
<custom-ident>
<image> =
<url> |
<image()> |
<image-set()> |
<cross-fade()> |
<element()> |
<gradient>
<image()> =
image( <image-tags>? [ <image-src>? , <color>? ]! )
<image-set()> =
image-set( <image-set-option># )
<cross-fade()> =
cross-fade( <cf-image># )
<element()> =
element( <id-selector> )
<image-tags> =
ltr |
rtl
<image-src> =
<url> |
<string>
<image-set-option> =
[ <image> | <string> ] [ <resolution> || type( <string> ) ]?
<cf-image> =
[ <image> | <color> ] &&
<percentage [0,100]>?
<id-selector> =
<hash-token>
Beispiele
>Einstellen eines Suffixes für einen Zähler
HTML
html
<ul class="choices">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>None of the above</li>
</ul>
CSS
css
@counter-style options {
system: fixed;
symbols: A B C D;
suffix: ") ";
}
.choices {
list-style: options;
}
Ergebnis
Spezifikationen
| Specification |
|---|
| CSS Counter Styles Level 3> # counter-style-suffix> |
Browser-Kompatibilität
Siehe auch
- Andere
@counter-styleDeskriptoren:system,symbols,additive-symbols,negative,prefix,range,pad,speak-as, undfallback list-style,list-style-image,list-style-positionsymbols(): die funktionale Notation zur Erstellung anonymer Zählerstile- CSS Counter Styles Modul
- CSS Lists and Counters Modul