In the old days PCs weren't very interesting because the only sound they made was the wurring of the fan. In this article, I show you how, with just a few lines of code, you can give your webpage an extra touch of class by adding background music.
Welcome to Bucaro TecHelp!

Bucaro TecHelp
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Victims of Sandy Hook

Stop the Slaughter of Innocents. Congress is bought and paid for by gun lunatics and gun promotion groups. If you want to live in a safe America, help buy Congress back for America. Send a donation to Mayors Against Illegal Guns, 909 Third Avenue, 15th Floor New York, NY 10022

How to Add Background Music to Your Web Page

In the old days PCs weren't very interesting because the only sound they made was the wurring of the fan. Eventually music and multimedia came to the PC, but because of the low bandwidth of dial-up, the Internet was still dead quiet.

Today most Web users have a broad-band connection, so you can add music and even video to your webpage without slowing down the users browser much. In this article, I show you how, with just a few lines of code, you can give your webpage an extra touch of class by adding background music.

But first let me advise you to NOT add background music to your webpage. Why not? Because many Web users have intentionally disabled sound on their computers. Almost everybody likes music - their own music, not your music. Many people are playing their own favorite music while surfing the web. Personally my favorite music is the rarest sound on the planet - PEACE and QUIET.

That being said, and assuming you're intent on adding music to your webpage, first I'll show you two ways you should NOT use to add music, and then the correct way to add music to your webpage. The first way to NOT add music to your webpage is to use the <bgsound> tag, an example of this is shown below.

<bgsound src="SugarplumFairy.mp3" volume="-1000" loop="infinite" />

Below are some of the attributes you can use with the <bgsound> tag.

balance - a number between -10,000 and +10,000 that specifies how the volume will be divided between speakers.

loop - a number that specifies how many times a sound is to be played, or for continuous looping, the keyword "infinite".

src - the URL of the sound file to be played.

volume - a number between -10,000 and 0 that specifies the loudness.

You can place the code for the <bgsound> tag anywhere on your webpage. Why not use the <bgsound> tag? Because the it's not part of any W3C standard. It's an Internet Explorer proprietary tag that will work with any version of Internet Explorer (except version 1). The <bgsound> tag is not part of any W3C standard, but it's easy to use and it continues to work, even with Internet Explorer version 7.

The second way to NOT add music to your webpage is to use the <embed> tag, an example of this is shown below.

<embed src="SugarplumFairy.mp3" autostart="true" height="45" width="200" loop="true" />

RSS Feed RSS Feed


Follow Stephen Bucaro Follow @Stephen Bucaro


Web Design Sections

Fire HD
[Site User Agreement] [Privacy Policy] [Site map] [Search This Site] [Contact Form]
Copyright©2001-2016 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268