The <audio> element allows you to embed audio files on a website. Modern browsers can play these files using a built-in player without any plugins.
The simplest way to play audio is using the <audio> element with a <source> tag inside. The 'controls' attribute adds playback controls.
- 'controls': displays playback controls - 'autoplay': starts playback automatically - 'loop': repeats the playback - 'muted': plays audio muted - 'preload': sets preloading type (none, metadata, auto)
Since not all browsers support the same formats, it's recommended to include multiple <source> elements (e.g., MP3, OGG). The browser will play the first format it supports.
Use optimized, small-sized audio files for fast loading. Name files clearly and always include fallback text for unsupported browsers.
Please sign in to ask Lara about HTML audio element.
Select Language
Set theme
© 2025 ReadyTools. All rights reserved.