In the following simple trick, I am going to show you how to play audio in the background using HTML 5:
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="styles.css">
<title>Background Music</title>
<audio autoplay loop>
<source src="johann_sebastian_bach_air.ogg">
<source src="johann_sebastian_bach_air.mp3">
</audio
<h1>You're hooked on Bach!</h1>
</html>
Kindly change the audio source name to your own.