suffix
@counter-style 規則的 suffix 描述符指定將新增到標記表示末尾的內容。
語法
css
/* <symbol> value: string, image, or identifier */
suffix: "";
suffix: ") ";
suffix: url("bullet.png");
值
suffix 描述符接受單個 <symbol> 作為其值。
<symbol>-
指定一個附加到標記表示的
<symbol>。它可以是<string>、<image>或<custom-ident>。
正式定義
| 相關的 at-rule | @counter-style |
|---|---|
| 初始值 | “.” (句號後跟一個空格) |
| 計算值 | 同指定值 |
正式語法
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>
示例
為計數器設定字尾
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;
}
結果
規範
| 規範 |
|---|
| CSS Counter Styles Level 3 # counter-style-suffix |
瀏覽器相容性
載入中…
另見
- 其他
@counter-style描述符:system、symbols、additive-symbols、negative、prefix、range、pad、speak-as和fallback list-style、list-style-image、list-style-positionsymbols():用於建立匿名計數器樣式的功能表示法- CSS 計數器樣式模組
- CSS 列表和計數器模組