Computer >> Computer tutorials >  >> Programming >> CSS

CSS play-during property


This property specifies a sound to be played as a background while an element's content is spoken. Possible values could be any of the followings −

  • URI − The sound designated by this <uri> is played as a background while the element's content is spoken.
  • mix − When present, this keyword means that the sound inherited from the parent element's play-during property continues to play and the sound designated by the uri is mixed with it. If the mix is not specified, the element's background sound replaces the parent's.
  • repeat − When present, this keyword means that the sound will repeat if it is too short to fill the entire duration of the element. Otherwise, the sound plays once and then stops.
  • auto − The sound of the parent element continues to play.
  • none − This keyword means that there is silence.

Example

You can try the following code to implement CSS play-during property −

<style>
   <!--
      blockquote.sad { play-during: url("violins.aiff") }
      blockquote q { play-during: url("harp.wav") mix }
      span.quiet { play-during: none }
   -->
</style>