Open In App

CSS Frequency Value

Last Updated : 08 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The frequency is a data type of CSS value. It represents the frequency dimension of sound like speaking frequency. This value is currently not used by any CSS properties. Back before it was used to measure the sound wave frequency. It holds a number with a unit(Hz or kHz).

Syntax: 

frequency: number Hz | kHz

Units: This CSS value accepts two types of units as mentioned above and described below:

  • Hz: This unit represents a frequency in hertz(20Hz).
  • kHz: This unit represents a frequency in kilohertz.

Note: There is a relation between these two units(1kHZ = 1000Hz).

The below example illustrate the CSS Value Frequency units:

Example:

Valid:   120Hz
         14.44kHz or 14440 Hz
         160Khz (It is case insensitive)
         +-0Hz

Invalid: 180 (Unit is missing)
         48 Hz (Space between the number and unit)
         0 (Invalid, it can be unitless but not allowed)

Example: Below code will not work in any browsers, since this property is deprecated and not supported by any browsers anymore.

HTML




<!DOCTYPE html>
<html>
<head>
    <title>
        CSS Frequency Value
    </title>
</head>
 
<body style="text-align: center;">
    <h1 style="color: green;">
        GeekSforGeeks
    </h1>
    <p>CSS Value | Frequency </p>
    <audio>
        <source src="sample.mp3" type="audio/mpeg" frequency="120Hz">
    </audio>
</body>
</html>


 Supported Browsers: Currently this value is not supported by any browsers.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads