HTML | <bgsound> tag

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:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>

chevron_right


Output:

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

  • Internet Explorer

full-stack-img

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.