CSS <frequency> Data Type
Description
The CSS <frequency>
data type represents a frequency dimension, such as the pitch of a speaking voice. It is not currently used in any CSS properties, but it is defined in the CSS specifications in case it is needed in the future.
Frequency values are dimensions denoted by <frequency>
. They are specified as a number followed by one of the following units:
- Hz (Hertz)
- kHz (Kilohertz)
For example, valid frequency values include:
12Hz
4.3Hz
14kHz
As with all CSS dimensions, there is no space between the unit literal and the number.
The <frequency>
data type is a <dimension>
, which means that it can be used in the calc()
function. For example, the following expression would evaluate to 16Hz:
calc(12Hz + 4Hz)
However, since there are no CSS properties that currently accept frequency values, this expression would be useless.
It is possible that the <frequency>
data type will be used in future CSS properties, such as properties that control the pitch of audio effects. However, until that time, it is a dormant data type.
Syntax
property: <frequency>;
Values
- HzFrequency in hertz, represents the number of cycles per second.
- kHzFrequency in kilohertz, represents the number of thousands of cycles per second (in other words, 1kHz equals 1000Hz).
Example
Unfortunately, no CSS properties use the frequency data type yet.
Browser Support
The following table will show you the current browser support for the CSS frequency
data type.
Desktop | |||||
x | x | x | x | x |
Tablets / Mobile | |||||
x | x | x | x | x | x |
Last updated by CSSPortal on: 7th October 2023