How to Embed a QuickTime MP3 in DIV
Apple's QuickTime software allows PC and Mac users to play many types of multimedia, including audio, video, images and animations; this includes support for the MP3 audio format. Any user with QuickTime installed on their system can access MP3 files in their browser using the program's interface, so long as the web page author defines the proper file type in their embedding code. Adding this embedding code to a DIV element requires just five lines of HTML.
Instructions
-
-
1
Place your MP3 file in the same folder as your web page.
-
2
Open the HTML code of your web page. If you use a visual editing program such as Microsoft Expression Web or FrontPage, open your page and click on the DIV area where you want your embedded MP3 to appear. Change the display mode to Code View to see the HTML code that controls that portion of your page. If you use a text-editing program like Notepad or WordPad, simply open your page in the text editor and find the DIV where you want to embed your MP3.
-
-
3
Create a blank line between the opening (<div>) and closing (</div>) DIV element tags.
-
4
Copy and paste the code below onto the blank line created in the previous step:
<object width="200" height="25">
<param name="src" value="sample.mp3">
<param name="autoplay" value="false">
<embed src="sample.mp3" type="video/quicktime" width="200" height="50" autoplay="false">
</object> -
5
Update the code parameters. Modify the width and height values found on lines one and four to suit your layout needs. Change the sample MP3 file name provided on lines two and four to match the actual name of your file. In addition, if you want the MP3 to automatically play when your web page loads, change the autoplay value on lines three and four from "false" to "true."
-
6
Save your web page, and then open it in your browser. Your MP3 file plays in the browser, using QuickTime, at the DIV location you selected in Step 2.
-
1
References
- Photo Credit adress bar image by Wiktor Osiecki from Fotolia.com