<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 值和單位模組第 4 級 # typedef-frequency-percentage |
瀏覽器相容性
目前沒有瀏覽器支援此功能。