1、网页中插入背景音乐代码
网页中加入音乐代码是放在<body>与</body>之间的。代码:
<embed src="音乐名及路径" autostart="true" loop="true" width="数值" height="数值"></embed>
说明:
数值在网页中一般设置为0
<embed>......</embed>是在页面中加入声音的标记。
src= 表示指向音乐文件的全名及路径。
2、各种格式的音乐的插入
(1).mid音乐格式
<embed src="音乐文件和地址" type="audio/midi" hidden="false" autostart="true" loop="true" height="height_num" width="width_num"></embed>
(2).mp3音乐格式
<embed controller="true" width="width_num" height="height_num" src="音乐文件和地址" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html"></embed>
(3).avi音乐格式
<embed src="音乐文件和地址" border="0" height="height_num" width="width_num" type="application/x-mplayer2"></embed>
(4).mpg音乐格式
<embed src="音乐文件和地址" border="0" height="height_num" width="width_num" type="application/x-mplayer2"></embed>
(5).mov音乐格式
<embed controller="true" width="width_num" height="height_num" src="音乐文件和地址" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html"></embed>
(6).rm音乐格式
<OBJECT height="height_num">
<PARAM NAME="CONTROLS" VALUE="ImageWindow">
<PARAM NAME="AUTOSTART" Value="true">
<PARAM NAME="src" VALUE="音乐文件和地址">
<embed height="height_num" width="width_num" controls="ImageWindow" src="音乐文件和地址" type="audio/x-pn-reslaudio-plugin" autostart="true" nolabels="0" autogotourl="-1"></OBJECT>
上面的都是使用播放器的,如果只是想播放背景音乐的话可以使用如下简单语句:
<bgsound src="Filename with full URL" loop=1>
loop后面是循环的次数,-1代表无限循环。
联系客服