Latest web development tutorials

HTML audio controls property

HTML audio tag Reference Manual HTML <audio> tag

Examples

With the browser's default controls <audio> element:

<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
您的浏览器不支持 audio 元素。
</audio>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 9+, Firefox, Opera, Chrome, and Safari browser support controls property.

Note: Internet Explorer 8 and earlier versions of IE do not support the <audio> tag.


Definition and Usage

controls attribute is a Boolean attribute.

If the attribute is present, it specifies the display of audio controls.

Audio and video controls include:

  • Broadcast
  • time out
  • progress bar
  • volume

Differences between HTML 4.01 and HTML5

<Audio> elements in HTML5 is newly added.


The difference between HTML and XHTML

In XHTML, this property is not allowed shorthand, controls property must be defined as <audio controls = "controls">.


grammar

<audio controls>


HTML audio tag Reference Manual HTML <audio> tag