
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to add background music in HTML?
The HTML <bgsound> tag is used to play music in the background. This tag is for Internet Explorer only.
Example
You can try to run the following code to add background music in HTML −
<!DOCTYPE html> <html> <head> <title>HTML bgsound Tag</title> </head> <body> <bgsound src = "/html/yourfile.mdi"/> <p>Plays sound file in the background.</p> </body> </html>
The HTML <bgsound> tag also supports the following attributes −
Attribute | Value | Description |
---|---|---|
loop | number | Lets you replay a background soundtrack a certain number of times. |
src | URL | Specifies the path of the sound file. |
- Related Articles
- How to add background music to your web page?
- How to play background music in Android app?
- How can I add video to site background in HTML 5?
- How to Add an Image in Text Background using HTML and CSS?
- What is Android background music service?
- How to set background color in HTML?
- How to add background Image to JFrame in Java
- How to add image as background into chart in Excel?
- How to add video in HTML page?
- How to add a layer in HTML?
- How to add a paragraph in HTML?
- How to add preformatted text in HTML?
- How to add a variable in HTML?
- How to add horizontal line in HTML?
- How to add emoji in HTML document?

Advertisements