Open In App

HTML | <bgsound> tag

Improve
Improve
Like Article
Like
Save
Share
Report

The HTML <bgsound> tag is used to play the soundtrack in the background, when you leave the page behind and open a new tab this tag will continuously play the track in the background.
This tag is not for other browsers except the Internet Explorer. It does not display any graphical interface just played the track in the background.

Syntax:

<bgsound src="">

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.

Below example illustrate the HTML <bgsound> tag:
Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>
      HTML <bgsound> Tag
  </title>
    <style>
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <center>
        <h1>GeeksforGeeks</h1>
        <h2>HTML <bgsound> tag</h2>
        <bgsound src=
         <p>please plugin speaker/headphone to listen to the sound.</p>
    </center>
</body>
  
</html>


Output:

Supported Browsers: The supported browsers by HTML | <bgsound> tag are listed below:

  • Internet Explorer

Last Updated : 27 Aug, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads