首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

@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

语法

代码语言:javascript
复制
/* 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与指定speak-as__:数字具有相同的效果.bullets由用户代理定义的用于表示无序列表项的短语或音频提示将被读出。数字计数器的数值将在文档language.word中被读出。用户代理将产生正常的计数器值并读取在文档language.pell-out用户代理将生成一个正常的计数器表示,并逐字逐句读出它。如果用户代理不知道如何读出辅助计数器符号,用户代理可能会读出来,就像speak-as数字的值<counter-style-name>如果指定了另一个计数器的名称,柜台将以该柜台风格指定的形式说出来,有点像指定fallback描述。如果指定的样式不存在,说作为描述符假定值为自动

正式语法

代码语言:javascript
复制
auto | bullets | numbers | words | spell-out | <counter-style-name>where 
<counter-style-name> = <custom-ident>

示例

HTML

代码语言:javascript
复制
<ul class="list">
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
  <li>Four</li>
  <li>Five</li>
</ul>

CSS

代码语言:javascript
复制
@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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com