Method: 1. Use the "" statement; 2. Use "" statement; 3. Use the "
" statement.
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
Add music to HTML web page
Method 1:
<audio autoplay="autoplay" controls="controls"loop="loop" preload="auto" src="http://demo.mimvp.com/html5/take_you_fly.mp3"> 你的浏览器版本太低,不支持audio标签 </audio>
This method will display the playback device.
Method 2:
<embed src="music/We Don't Talk Anymore.mp3" autostart="true" loop="true" hidden="true"></embed>
This method mainly supports many players. Solved the browser compatibility issue to a certain extent.
Method three:
<bgsound src="音乐保存的绝对路径" autostart=true loop=infinite>
Recommended tutorial: "html video tutorial"
The above is the detailed content of How to add music to html web page. For more information, please follow other related articles on the PHP Chinese website!