Skip to content
Related Articles

Related Articles

CSS Frequency Value
  • Last Updated : 05 Nov, 2020

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: 

frequancy: 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 this two units(1kHZ = 1000Hz).

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

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


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

My Personal Notes arrow_drop_up
Recommended Articles
Page :