frequency Redirect 1

Summary

The <frequency>CSS data types denotes a frequency dimension, like the pitch of a speaking voice. They consists of a <number> immediately followed by the unit. Like for any CSS dimension, there is no space between the unit literal and the number.

Even if all units represent the same time for the value 0, the unit may not be omitted in that case as it isn't a <length>: 0 is invalid and does not represent 0Hz, 0kHz. Though the units are case-insensitive in CSS, it is good practice to use a capital H for Hz and kHz, as in the SI, Hertz being a family noun.

Examples

These are valid frequency values:

12Hz Positive integer.
-456kHz Negative integer.
4.3Hz Non-integer.
14KhZ The unit is case-insensitive, though non-SI capitalization is not recommended.
+0Hz Zero, with a leading + and the unit.
-0kHz Zero, with a leading - and the unit (Though strange, this is an allowed value).

These are invalid frequency values:

12.0 This is a <number>, not an <frequency>, it must have a unit.
7 Hz No space is allowed between the <number> and the unit.
0 Zero values can be written without a unit only if there are <length> values, not <frequency>.

Specifications

This data type was initially introduced in CSS Level 2 for the now obsoleted auralmedia group, where it was used to define the pitch of the voice. This has been deprecated since then, but the <frequency> data type has been reintroduced in CSS3, though no CSS property is using it at the moment.