Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

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 Regel @counter-style gibt den Inhalt an, der am Ende der Markerdarstellung 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 an die Markerdarstellung angehängt wird. Es kann eine <string>, ein <image> oder ein <custom-ident> sein.

Formale Definition

Zugehörige @-Regel@counter-style
Anfangswert". " (full stop followed by a space)
Berechneter Wertwie 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

Ein Suffix für einen Zähler festlegen

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