How to Embed Background Music in HTML

How to Embed Background Music in HTML thumbnail
Add music to your website using HTML.

When you embed an audio file, such as a song, into the background of your Web page, you allow it be heard by your visitors when they access your website. If you have an Internet page, such as band profile or holiday announcement, consider adding this feature to enhance your content. The HyperText Markup Language (HTML) gives you total control over how you add your audio. Using your audio file and your text editor application, embed the background music of your choice into your HTML document.

Instructions

    • 1

      Access a free Web hosting service, such as FileFactory or MediaFire and follow the instructions to upload (add) your music file to the provider's server. Copy the Web address that displays after you complete the upload process. A host provides a means for sharing your music on the Internet.

    • 2

      Bring up your text editor application and start a new HTML page or open an existing file.

    • 3

      Place your cursor anywhere underneath the "<body>" tag in the document. Type in the "<embed></embed>" tags that allow you to add your audio to the page.

    • 4

      Enter "name=" and "src=" inside the first "<embed>" tag. Type in the title of the song after the "name" entry and enter the URL address for the music after the "src" descriptor. For example:

      <embed name="songname" src="http://www.host.com/song.wav">

    • 5

      Type in "hidden=" inside the first "<embed>" tag. The hidden descriptor determines whether your music player is visible on the Web page or not. Type "true" to mask your player, or enter "false" to allow the media to be seen. To illustrate:

      <embed name="songname" src="http://www.host.com/song.wav" hidden="true">

    • 6

      Enter "autostart=" in the "<embed>" tag and follow this with a "true" or "false" value. Type in "true" if you want your music to play automatically on page load. Otherwise, if you set your player to be visible in Step 5, enter "false" to give your visitors the option to play the music when they want to.

    • 7

      Type "loop=" inside the "<embed>" tag and enter "true" to enable your music to play over and over or "false" to specify that you want it to play just once. The complete code now looks as follows:

      <embed name="songname" src="http://www.host.com/song.wav" hidden="true" autostart="false" loop="false">

      </embed>

    • 8

      Save your file. Your music is now part of your HTML page.

Related Searches:

References

Resources

  • Photo Credit music image by Markus Götze from Fotolia.com

Comments

You May Also Like

Related Ads

Featured