CSS

符号 | @counter-style.symbols

@counter-style.symbols

symbols描述符用于指定指定的柜台系统将用来构造计数器表示的符号。符号可以是字符串,图像或标识符。描述符的值system循环的数字的字母的符号的固定的,必须指定符号描述符。当使用添加剂系统时,使用additive-symbols描述符来指定符号。

符号描述符的值可能包括:

  • 字符串 - 用单引号或双引号括起来的字符序列。反斜杠()可用于转义特殊字符。例如,可以用“\ 24B6”格式指定Unicode字符。

  • 图像 - 格式为url(path-to-image.png)

  • 标识符

Related at-rule@counter-style
初始值N/A
适用媒体all
计算值as specified
正规顺序order of appearance in the formal grammar of the values

语法

symbols: A B C D E; symbols: "\24B6" "\24B7" "\24B8" D E; symbols: "0" "1" "2" "4" "5" "6" "7" "8" "9"; symbols: url('first.svg') url('second.svg') url('third.svg' symbols: indic-numbers;

<symbol>代表<symbol>在柜台系统内使用。

正式语法

<symbol>+where <symbol> = <string> | <image> | <ident> where <image> = <url> | <image()> | <image-set()> | <element()> | <cross-fade()> | <gradient> where <image()> = image( [ [ <image> | <string> ]? , <color>? ]! ) <image-set()> = image-set( <image-set-option># ) <element()> = element( <id-selector> ) <cross-fade()> = cross-fade( <cf-mixing-image> , <cf-final-image>? ) <gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color> <image-set-option> = [ <image> | <string> ] <resolution> <cf-mixing-image> = <percentage>? && <image> <cf-final-image> = <image> | <color> <linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> ) <repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> ) <radial-gradient()> = radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> ) <repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> ) where <rgb()> = rgb( <rgb-component>#{3} ) <rgba()> = rgba( <rgb-component>#{3} , <alpha-value> ) <hsl()> = hsl( <hue>, <percentage>, <percentage> ) <hsla()> = hsla( <hue>, <percentage>, <percentage>, <alpha-value> ) <named-color> = <ident> <deprecated-system-color> = ActiveBorder | ActiveCaption | AppWorkspace | Background | ButtonFace | ButtonHighlight | ButtonShadow | ButtonText | CaptionText | GrayText | Highlight | HighlightText | InactiveBorder | InactiveCaption | InactiveCaptionText | InfoBackground | InfoText | Menu | MenuText | Scrollbar | ThreeDDarkShadow | ThreeDFace | ThreeDHighlight | ThreeDLightShadow | ThreeDShadow | Window | WindowFrame | WindowText <side-or-corner> = [ left | right ] || [ top | bottom ] <color-stop-list> = <color-stop>{2,} <ending-shape> = circle | ellipse <size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2} <position> = [[ left | center | right | top | bottom | <length-percentage> ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] | [ center | [ left | right ] <length-percentage>? ] && [ center | [ top | bottom ] <length-percentage>? ]] where <rgb-component> = <integer> | <percentage> <alpha-value> = <number> <hue> = <number> <color-stop> = <color> <length-percentage>? <length-percentage> = <length> | <percentage>

示例

HTML

<ul class="list"> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> </ul>

CSS

@counter-style symbols-example { system: fixed; symbols: A "1" "\24B7" D E; } .list { list-style: symbols-example; }

结果

规范

SpecificationStatusComment
CSS Counter Styles Level 3The definition of 'symbols' in that specification.Candidate RecommendationInitial definition

浏览器兼容性

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic supportNo support33 (33)1No supportNo supportNo support

FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic supportNo support33 (33)1No supportNo supportNo support