Background Music Code




HTML Background Music Code



You can add HTML background music code to your website by using the <audio> element, but omitting the controls attribute. Thecontrols attribute specifies that there should be controls (such as a "Play" button, "Pause" button etc) so by removing this attribute, no controls will be displayed.



Try It


You can try this using the example below. Update control with autoplay, then clickRefresh Result.


This will hide the controls and automatically play the music in the background.




























1


<audio src="/music/good_enough.mp3" controls>




2


<p>If you are reading this, it is because your browser does not support the audio element.</p>




3


</audio>















0/Post a Comment/Comments

Previous Post Next Post

Sidebar Ads

Ads1
Ads2