@counter-style.speak-as
@counter-style.speak-as
speak-as
描述符指定如何与给定构造的计数器符号@counter-style
将在所说形式来表示。例如,作者可以指定一个计数器符号作为数字值或者只是用音频提示表示。
Related at-rule | @counter-style |
---|---|
初始值 | auto |
适用媒体 | all |
计算值 | as specified |
正规顺序 | the unique non-ambiguous order defined by the formal grammar |
语法
/* Keyword values */
speak-as: auto;
speak-as: bullets;
speak-as: numbers;
speak-as: words;
speak-as: spell-out;
/* @counter-style name value */
speak-as: <counter-style-name>;
值
auto
如果speak-as
指定的值为auto
,那么speak-as
将根据system
描述符的值确定有效值。如果这个值system
是字母的话
,那么这个有效值speak-as
就会拼写出来
。如果system
是循环
,有效值speak-as
将是子弹
。如果system
是扩展
,则值speak-as
将与扩展
样式上指定了speak-as__:auto
的值相同。
正式语法
auto | bullets | numbers | words | spell-out | <counter-style-name>where
<counter-style-name> = <custom-ident>
示例
HTML
<ul class="list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ul>
CSS
@counter-style speak-as-example {
system: fixed;
symbols: ;
suffix: " ";
speak-as: numbers;
}
.list {
list-style: speak-as-example;
}
结果
规格
Specification | Status | Comment |
---|---|---|
CSS Counter Styles Level 3The definition of 'speak-as' in that specification. | Candidate Recommendation | Initial definition. |
浏览器兼容性
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | No support | 33 (33) | No support | No support | No support |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | No support | 33 (33) | No support | No support | No support |