How to HTML Embed an MP3 File

To play your favorite songs on your website, it is necessary to embed the HTML code of the file. This allows friends and family members to enjoy music while perusing your site. There are a few different ways to embed an MP3 file into an HTML document. You can instruct the song to play automatically, to start playing by clicking on a link or give the user a control panel to adjust sound settings.

Instructions

  1. Automatic Play

    • 1

      Open the HTML document or Web design program document that you wish your music to play on when the page is loaded.

    • 2

      Type "<embed src="yoursong.mp3">" (without the quotation marks) and press the "Enter" key. Then type "<noembed> <bgsound src="yoursong.mp3"> </noembed>". Replace "yoursong.mp3" with your song file's name. This should go into the "<head>" section of your HTML document or Web design program.

    • 3

      Upload the HTML document or Web page and the MP3 file to the Web server in the same directory as your website. Depending on which Web server you use, this process will vary.

    Control Panel

    • 4

      Open the HTML document or Web design program document that you wish to add music to.

    • 5

      Enter "<embed src="yoursong.mp3" (without quotation marks and replacing "yoursong.mp3" with your song file's name) and then press the "Enter" key. Type "width=140 height=40 autostart=false loop=FALSE>" (without quotation marks) and press the "Enter" key. Then type "</embed>" (without quotation marks). Type this into the HTML document or Web design program anywhere you want the control panel to appear.

    • 6

      Upload the HTML document or Web page and MP3 file to the Web server in the same directory as your website.

    Click a Link

    • 7

      Open the HTML document or Web design program to which you want to add a link to play your MP3 file.

    • 8

      Type "<a href="yoursong.mp3">Click to play music </a>" (without quotation marks and replacing "yoursong.mp3" with your song file's name) anywhere in the HTML document or Web design program document you wish the link to appear.

    • 9

      Upload the HTML document or Web page and the MP3 file to the Web server in the same directory as the rest of the documents in your website.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured