CSS <frequency-percentage> Data Type
The <frequency-percentage> data type is a value that can be either a <frequency> or a <percentage>.
Description
The <frequency-percentage> CSS data type represents a value that can be either a <frequency> or a <percentage>. It exists for properties where a rate can be given either as an absolute amount, in hertz (Hz) or kilohertz (kHz), or as a proportion of some reference frequency. For example, a pitch could be written as 440Hz or as 120% of a default pitch.
Like <length-percentage> and <angle-percentage>, this combined type mainly simplifies how property syntax is written in the specifications. When a percentage is used, the property that accepts it defines what the percentage is relative to. Both kinds of value can also be mixed inside a math function, for example calc(50% + 20Hz), where the percentage resolves to a frequency before the calculation is done.
In practice, <frequency-percentage> was intended for speech and aural style properties, such as voice pitch, which are not implemented in current web browsers. No property that browsers support today accepts this type, so it is not something you can use in everyday stylesheets. It is documented here for completeness and because it appears in the CSS Values and Units specification.
Example syntax (not supported by browsers):
/* From the CSS Speech specification: voice-pitch */
.narrator {
voice-pitch: 220Hz; /* <frequency> */
}
.excited {
voice-pitch: 130%; /* <percentage> */
}
.mixed {
voice-pitch: calc(50% + 20Hz);
}
If you need to work with frequencies on the web today, the Web Audio API in JavaScript is the practical option, with CSS used only for the visual presentation.
Syntax
<frequency-percentage> = <frequency> | <percentage>
Values
- <frequency>Refer to <frequency> for possible values.
- <percentage>Refer to <percentage> for possible values.
Example
Browser Support
The following information will show you the current browser support for the CSS frequency-percentage data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





