半点优化网 http://www.bdxc.net/
当前位置首页 > 网站建设> 正文

网页设计与制作音乐播放界面如何播放音乐

2022-10-08 01:33:45 暂无评论 193 网站建设 播放   音乐   网页设计

网页设计与制作音乐播放界面需要在页面中插入HTML5的音频标签audio,即可播放音乐。

工具/原料:

华硕DN20

win10

浏览器1.026

1、先打开常用的网页设计的软件,然后新建一个网页文件。

2、进行一个简单的页面布局,让音乐播放器显示在网页的中间。并添加简单的样式。

<style type=text/css>

#music_player{width:400px; height:150px;background:#ff9966;margin:200px auto;}

</style>

<div id=music_player class=> </div>

3、在浏览器中进程预览,看下位置是否合适。

4、利用HTML5的标签audio标签进行音乐播放器的设置。

<div id=music_player class=>

<audio controls>

<source src=D:\KuGou\苍鹰-拜秦陵.mp3 type=audio/mpeg>

</audio>

</div>

5、播放器设置好以后,我们在<source src=歌曲地址">插入歌曲的地址,就可以自动播放了。例如:

<audio controls>

<source src=D:\KuGou\苍鹰-拜秦陵.mp3 type=audio/mpeg>

</audio>

6、在浏览者进行浏览,就可以发现点击播放后就响起音乐来了。

随机文章


    Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/bdxc.net/e/class/connect.php) is not within the allowed path(s): (/www/wwwroot/www.bdxc.net/:/tmp/) in /www/wwwroot/www.bdxc.net/1.php on line 4

    Warning: require(/www/wwwroot/bdxc.net/e/class/connect.php): failed to open stream: Operation not permitted in /www/wwwroot/www.bdxc.net/1.php on line 4

    Fatal error: require(): Failed opening required '/www/wwwroot/bdxc.net/e/class/connect.php' (include_path='.:/www/server/php/56/lib/php') in /www/wwwroot/www.bdxc.net/1.php on line 4