語法
<frequency> 資料型別由一個 <number> 後面跟著以下列出的其中一個單位組成。與所有 CSS 維度一樣,單位字面量和數字之間沒有空格。
單位
注意: 儘管數字 0 無論單位如何總是相同的,但單位不能省略。換句話說,0 是無效的,不表示 0Hz 或 0kHz。儘管單位不區分大小寫,但按照 國際單位制(SI)的規定,對 Hz 和 kHz 使用大寫“H”是一個好習慣。
示例
有效的頻率值
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 級 # frequency-value |
瀏覽器相容性
目前沒有瀏覽器支援此功能。