suffix
Baseline
Weitgehend verfügbar
Diese Funktion ist gut etabliert und funktioniert auf vielen Geräten und in vielen Browserversionen. Sie ist seit September 2023 browserübergreifend verfügbar.
Der suffix Deskriptor der @counter-style-Regel spezifiziert den 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 Wert ein einzelnes <symbol>:
<symbol>-
Gibt ein
<symbol>an, das der 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
>Festlegen 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
| Spezifikation |
|---|
| CSS Counter Styles Level 3> # counter-style-suffix> |
Browser-Kompatibilität
Siehe auch
- Andere
@counter-style-Deskriptoren: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-Zählerstile Modul
- CSS-Listen und Zähler Modul