" statement; 2. Use the "" statement; 3. Use "< object data="audio file path"/>" statement."/> " statement; 2. Use the "" statement; 3. Use "< object data="audio file path"/>" statement.">

Home >Web Front-end >HTML Tutorial >How to add music in html

How to add music in html

青灯夜游
青灯夜游Original
2021-06-03 17:55:0338857browse

htmlHow to add music: 1. Use the "" statement; 2. Use "" statement; 3. Use the "" statement.

How to add music in html

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

1. Use HTML5

Example:

<!DOCTYPE HTML>
<html>
<body>

<audio src="/i/horse.ogg" controls="controls">
Your browser does not support the audio element.
</audio>

</body>
</html>

How to add music in html

2. Use the element

The following code snippet can display MP3 files embedded in web pages:

<embed height="50" width="100" src="horse.mp3">

3. Use the element

The following code snippet can display MP3 files embedded in web pages:

<object height="50" width="100" data="horse.mp3"></object>

Recommended tutorial: "html video tutorial"

The above is the detailed content of How to add music in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn