一、添加背景音乐时,一般会用到两种标签:
1、<bgsound>
2、<embed>
二、一般用法 :
<bgsound src="音频源" autostart="true" loop="false" />
<embed src="音频源" autostart="true" loop="false" />
三、标签属性 :
1、autostart 当为 true 时 是自动播放模式 。反之, 当为false时 为一开始不进行自动播放(默认为false);
2、loop 当为 true 时 是无限次重播,false为不重播,某一具体值(正整数)为重播多少次;
3、当添加属性 hidden="true" 时 为隐藏控制面板;
四、兼容问题
1、<bgsound> 标签 为 IE
2、<embed> 为其它
3、值得注意的是 当为IE9时 , 两标签都为支持;
TIPS :
例如:给 <div class=”mp3”></div>添加音频播放文件时。
(一)、正常情况下的写法:<