Home Up Feedback Banner Exchange Link Xchange

Adding Music

 

Home
What is HTML
How To Start
Basic HTML Page
Formating Text
HTML Hyperlinks
HTML Lists
Adding Graphics
HTML Tables
HTML Forms
HTML Frames
Head Tags
Meta Tags
Body Tags
Directory Path
Adding Music
Creating Marquee
HTML Image Maps
Drop Down Menu
Cool Form Controls
Cool Glowing Text
CSS Tutorials

 

 
 

 

 

 

 

 

Google
How to Put Music in Web Page:

 You can also put music in your web page to make it more attractive to user. There are two methods to put music in your web pages.
 1. Automatically start when page is load.
 2. Manually started by user. 

1. How to Put Background Music:

     You can play a music file when you page is loaded. The user can listen the sound with viewing the web page. The tag which can use to put the background music is  <bgSound>. This tag is a single tag and have not any closing tag. The bgsound tag can be placed within the page anywhere. For example you can place it in header section even you can place it within body section. You can use all the music files supported by windows media player for internet Explorer.

For example you can use .wav  and .mid files.

(work with IE 3.0 or later ,  Netscape All).

  Example:

 
   <html>
        <head><title>    Your page Title    </title>
              </head>
    <body>
      
     <bgsound src="your-file-name.mid">

    </body>
    </html>
 

  You can put this line of tag also in between head section it will work.

  Points to Remember for a Good BgSound Tag:
  Remember that the file you are wishing to play as a background music in your web page should not too much heavy in size. Because the page will be displayed after downloading all of its content from a web server. So if your music file size is heavy then the page will load more late. Try to use the music files with size between 1kb to 50kb. And upload this music file in your web server directory.

2. How to Put Music which can played Manually:

      You can also play music files with click of your mouse in web pages. This method Works with long size files and can play any type of extension depending upon player installed in viewer's System.
Example:


    <a href="your-file-name.wav"> Click Here to Listen Song </a>
 

Result:
                Click Here to Listen Song

You can use wav , mid , mp3 , ram , rm files to play.
You can also use images as linking to sound files.
 

 
    <a href="your-file-name.extension" target="_blank">
    <img src="your-image.gif"></a>   
 

Result:
                                            Listen Song 

Putting Embed Player in Web Page:
You can also put a media player in your web page by using following tag.


 <embed src="file_name.wav" WIDTH="145" HEIGHT="60" AUTOSTART="TRUE"   
 LOOP="FALSE">
 

This will Looks Like this:

Your Browser Does not support embeded media player

Attributes of Music Tags:

 Following are some attributes which can be used with bgsound or embeded player.   

1. Src:

     With this attribute you can set the source music file name to bgsound or embeded player.

For example:


        <bgsound src="your-file-name.mid">.
 

 
2. LOOP:

     If you want that your music file repeat playing after playing then you can use this loop attribute with music tags. For example if you want that your file played 2 times then set loop="2" , if you want that your file loops forever then set  loop="-1".

Example:


    <bgsound src="file-name.mid" loop="-1">
 

 
3. Auto Start:

    This tag is used with embed player and it is used when you are wishing to play your music file on page load. If its value is set to false then file will not played on page load user have to manually play it by pressing the play button.

 Next Page

 

Home What is HTML How To Start Basic HTML Page Formating Text HTML Hyperlinks HTML Lists Adding Graphics HTML Tables HTML Forms HTML Frames Head Tags Meta Tags Body Tags Directory Path Adding Music Creating Marquee HTML Image Maps Drop Down Menu Cool Form Controls Cool Glowing Text CSS Tutorials

Send mail to fmuniversal@gmail.com with questions or comments about this web site.
Copyright © 2006 FM Universal