<frequency-percentage>

**<frequency-percentage>** 是 CSS 数据类型,表示一个可以是 <frequency><percentage> 的值。 频率值(例如说话声音的音调)目前在任何 CSS 属性中都没有使用。

语法

<frequency-percentage> 的值可以是 <frequency><percentage>;有关其语法的详细信息,请参阅各自的参考页面。

描述

在 calc() 中使用

如果在允许的类型中指定了 <frequency-percentage>,则表示百分比解析为频率,因此可以在 calc() 表达式中使用。

正式语法

<frequency-percentage> = 
<frequency> |
<percentage>

示例

有效的百分比值

90% Positive percentage
+90% Positive percentage with leading +
-90% Negative percentage — not valid for all properties that use percentages

无效的百分比值

90 % No space is allowed between the number and the unit

有效的频率值

12Hz     Positive integer
4.3Hz    Non-integer
14KhZ    The unit is case-insensitive, though non-SI capitalization is not recommended.
+0Hz     Zero, with a leading + and a unit
-0kHz    Zero, with a leading - and a unit

无效的频率值

12.0     This is a <number>, not an <frequency>, because it is missing a unit.
7 Hz     No space is allowed between the number and the unit.
0        Although unitless zero is an allowable <length>, it's an invalid <frequency>.

规范

规范
CSS Values and Units Module Level 4
# mixed-percentages

浏览器兼容性

BCD 表格仅在浏览器中加载

另请参阅