Home| About US |Website Development Tutorial| Ecommerce Tutorial

Back to Basic HTML Programming

Adding Music to HTML Code


Please Note:- the elements described in this section are not HTML. They are proprietary extensions. WebPages using these elements will be invalid. Newer browsers support the object element which is the preferred method for embedding multimedia in HTML.

When adding music or embedding sounds into and HTML page, there are two main tags. One is compatible with Microsoft's Internet Explorer, and the other with Mozilla based browsers, such as Mozilla Suite, FireFox, Netscape Navigator, etc.

Internet Explorer uses the Embed Src tag.

Mozilla uses the BGSound tag.

There are several options for use with this tag, as well.

The basic tag is

<EMBED SRC="file"> or <BGSOUND SRC="file">

So on, so forth. Replace file with the path to your music file. For example, <BGSOUND SRC="wikibooks.org/wiki.mp3">.


ADVANCED KNOWLEDGE


Showing A Player <EMBED SRC="file" WIDTH="144" HEIGHT="60"> [Not availible in Mozilla based browsers]

Looping The File <EMBED SRC="file" WIDTH="144" HEIGHT="60" LOOP="1"> <BGSOUND SRC="your_file.mid" LOOP="1">

Autoplaying The File <EMBED SRC="file" AUTOSTART="true" WIDTH="144" HEIGHT="60" LOOP="1"> [File automatically plays in Mozilla based browsers

 

 

Copyright © 2006  [Ebini Abraham Tamuno]. All rights reserved.