How to Use HTML to Put in Background Music

How to Use HTML to Put in Background Music thumbnail
You can set up your web page to play music.

If you want to play music in the background on your web page, you don't need advanced knowledge of Hyper Text Markup Language (HTML). The code for embedding a song is fairly simple, requiring only a few modifications for customization. This code creates a visible player, allowing visitors the choice of whether or not to listen. Giving this option is important: if visitors don't like your music, they probably won't stay on your site.

Instructions

    • 1

      Open the HTML file to which you want to add music in a word processing program or HTML editor such as Notepad.

    • 2

      Select the location in which you want the music player to appear. Make sure it's easily visible so site visitors can turn it off if desired. Placing the player at the very top or bottom of the page is typically recommended.

    • 3

      Add the following HTML code:

      <EMBED SRC="http://www.examplelocation.com/music.mp3"

      WIDTH="xx" HEIGHT="xx" AUTOSTART="xx" LOOP="xx">

      </EMBED>

      Replace "http://www.examplelocation.com/music.mp3" with the actual URL and name of the music file you want to play.

    • 4

      Set the width and height of the player to your preferred size.

    • 5

      Set the autostart command to "true" if you want the music to start automatically. Set the command to "false" if you want visitors to manually activate it.

    • 6

      Set the loop command to "true" if you want the music to loop, which means play continuously. Set it to "false" if you want it to play once and stop.

    • 7

      Save the HTML file and view it in a web browser to make sure it works correctly.

Tips & Warnings

  • Recommended size for the player is at least 150 pixels wide by 60 pixels high.

Related Searches:

References

  • Photo Credit Stockbyte/Stockbyte/Getty Images

Comments

You May Also Like

Related Ads

Featured