HTML <audio> Tag
Description
The <audio>
HTML element adds, plays and controls the audio recording settings on a web page. The path to the file is specified through the src attribute or the nested <source>
element. Inside the <audio>
container, you can write text that will be displayed in browsers that do not work with this element.
Properties
- Permitted Parents
- Any element that accepts embedded content.
- Content
<source>
,<track>
and text- Start/End Tags
- Start tag: required, End tag: required
Example
<audio controls><source src="audio/chime.mp3" type="audio/mpeg">Sorry your browser does not support the audio tag.</audio>
Attributes
Attribute | Definition |
---|---|
autoplay | Specifies that the audio will start playing as soon as it is ready. |
controls | Specifies that audio controls should be displayed (such as a play/pause button etc). . |
loop | Specifies that the audio will start over again, every time it is finished. |
muted | Specifies that the audio output should be muted. |
preload | Specifies if and how the author thinks the audio should be loaded when the page loads. |
src | Specifies the location of the audio file. Its value must be the URI of an audio file. |
Global Attributes
The <audio>
tag also supports the Global Attributes in HTML5
Event Attributes
The <audio>
tag also supports the Event Attributes in HTML5
Browser Support
Desktop | |||||
9 | Yes | 3 | 3.5 | 10.5 | 3.1 |
Tablets / Mobile | |||||
![]() |
|||||
3 | 18 | 4 | Yes | Yes | Yes |
Last updated by CSSPortal on: 6th December 2019
HTML Tags
- a
- abbr
- address
- area
- article
- aside
- audio
- b
- base
- bdi
- bdo
- blockquote
- body
- br
- button
- canvas
- caption
- cite
- code
- col
- colgroup
- comment
- datalist
- dd
- del
- details
- dfn
- dialog
- div
- dl
- doctype
- dt
- em
- embed
- fieldset
- figcaption
- figure
- footer
- form
- h1
- h2
- h3
- h4
- h5
- h6
- head
- header
- hr
- html
- i
- iframe
- img
- input
- ins
- kbd
- keygen
- label
- legend
- li
- link
- map
- mark
- menu
- meta
- meter
- nav
- noscript
- object
- ol
- optgroup
- option
- output
- p
- param
- picture
- pre
- progress
- q
- rp
- rt
- ruby
- s
- samp
- script
- section
- select
- small
- source
- span
- strong
- style
- sub
- summary
- sup
- table
- tbody
- td
- textarea
- tfoot
- th
- thead
- time
- title
- tr
- track
- u
- ul
- var
- video
- wbr