#27 HTML Audio Control

HTML Audio tag provides you to embedding an audio file on a web page.

Table of content

<audio> Tag

<audio> tag is used to define the sound content. controls attribute adds audio controls, like play, pause, and volume.

autoplay attribute allow audio to play automatically. <audio autoplay>

Add muted after autoplay to let your audio file start playing automatically (but muted). <audio controls autoplay muted>

<source> Tag

<source> tag defines multiple resource elements. For audio control the resource element is nothing but your sound file.

This sound file is specified with the help of name and it type.


See the Pen audio tag by Arpit (@soniarpit) on CodePen.

Previous: #26 HTML Input form* Attributes

Next: #28 HTML Video Control

Support CodeSnail

If you appreciate my work, or if it has helped you along your journey. It would mean a lot to me if you could write a message on my wall and share a cup of coffee (or tea) with me.

Buy Me A Coffee
Your subscription could not be saved. Please try again.
Your subscription has been successful.


Subscribe to our newsletter and stay updated.

Leave a Comment