CSS Reference Data Type

<frequency>

The <frequency> CSS data type represents a frequency dimension. The format of a time value is a <number> followed by a case-insensitive unit of frequency: Hertz or kilohertz.

Notes and Trivia

CSS <length> values allow removing the unit identifier from a value when that value is zero. When a <frequency> value is zero, on the other hand, the unit can not be omitted, as 0 alone won’t be a valid <frequency> value without its unit.

Hertz is a family noun, and so even though the units are case-insensitive and can be written in all-uppercase, all-lowercase, or capitalized forms, it is recommended to keep the H in uppercase at all times, and not to capitalize the other letters, thus abiding to the grammatical rules of the International System of Units.

Values

Hz
Hertz. It represents the number of occurrences per second.
kHz
KiloHertz. A kiloHertz is 1000 Hertz.

Examples

The following are all valid frequency values:

0kHz
75Hz
200KHZ /* valid, though not recommended */
-30000Hz
                

The following are invalid frequency values:

-10 Hz /* no space is allowed between the number and the unit */
0 /* 0 must have a unit of frequency */
5900 /* must have a unit of frequency */
                

Browser Support

The frequency value is not supported by any browser at this time.

Notes

The <frequency> data type is used in CSS properties that apply to a media type aural, which was introduced in CSS 2. The type aural is now deprecated, but the <frequency> data type has been reintroduced in CSS Level 3 in the Speech module defined for speech output, and which is a re-work of the previous CSS2 aural media group. The CSS properties defined in the Speech module enable authors to declaratively control the presentation of a document in the aural dimension, and the <frequency> values are used in properties that control the voice pitch.

Written by . Last updated February 4, 2015 at 4:53 pm by Manoela Ilic.

Do you have a suggestion, question or want to contribute? Submit an issue.