Open In App

CSS pause Property

The CSS pause property is used to define the pause time before and after the element. The pause property accepts two values pause-before and pause-after. If only one value is provided it applies to both properties.

Syntax:



pause: <'pause-before'> <'pause-after'>

Parameters: This property is the combination of two other property as mentioned above and described below:

Example 1: In this example, pause for 20 milliseconds, both before and after.






<!DOCTYPE html>
<html>
<head>
    <style>
        audio {
            pause: 20ms;
        }
    </style>
</head>
  
<body style="text-align: center;">
    <h1 style="color: green;">GeeksforGeeks</h1>
  
    <p>CSS pause Property</p>
  
    <audio controls>
        <source src=
                type="audio/mp3">
    </audio>
</body>
</html>

Output:

Example 2: In this example,  pause for 20 milliseconds before, and 10 milliseconds after.




<!DOCTYPE html>
<html>
<head>
    <style>
        audio {
            pause: 20ms 10ms;
        }
    </style>
</head>
  
<body style="text-align: center;">
    <h1 style="color: green;">GeeksforGeeks</h1>
  
    <p>CSS pause Property</p>
  
    <audio controls>
        <source src=
                type="audio/mp3">
    </audio>
</body>
</html>

Output:

Supported Browsers: This property is deprecated in CSS3 so the major browsers are not supported by this property


Article Tags :