Open In App

HTML bgsound Tag

Last Updated : 27 Nov, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The <bgsound> tag in HTML was used to embed a background sound in a webpage. However, this tag is deprecated and is no longer supported in modern web browsers.

  • Primarily supported by older versions of Internet Explorer.
  • Allowed embedding of an audio file that would play automatically in the background when a webpage loaded.
html
<!DOCTYPE html>
<html>

<body>
  <bgsound src="https://media.geeksforgeeks.org/wp-content/uploads/20190531135120/beep.mp3" />
  <p>please plugin speaker/headphone to listen to the sound.</p>
</body>

</html>

Syntax

<bgsound src="background-music.mp3" loop="true">

Attribute

  • src: This attribute holds the path of the tack that will be played in the background.
  • loop: This attribute holds a number that the number of times the track will play looping around.

Similar Reads