


How to display audio styles that can be played and paused in html? (code example)
This article mainly introduces you to the specific operation method of displaying audio in html. In this way, for users, the online playback function can greatly improve the efficiency of the site and also bring a certain amount of traffic. Hope it helps friends in need. Here we need to first understand the two important tags in html5.
1. HTML 5
2. HTML 5
The controls attribute specifies that the browser should provide playback controls for audio. If this property is set, it specifies that there is no script control set by the author.
htmlThe specific code example for displaying audio is as follows:
<!DOCTYPE HTML> <html> <body> <audio controls="controls"> <source src="so.ogg" type="audio/ogg"> <source src="so.mp3" type="audio/mpeg"> <embed height="100" width="100" src="song.mp3" /> </audio> </body> </html>
The above code will display on the page as follows:
Note:
The numbers in width and height represent the width and height of the player respectively.
src can be modified later to your own music address.
The above is an introduction to the relevant knowledge of how to embed audio in HTML5, which has certain reference value. I hope you will adopt it.
【Recommended related articles】
How to insert audio and video into web pages in html?
How to reload audio/video elements in html5 load()
html5 Stop (pause) the current playback The audio or video method pause()
##Details introduction to the effect of HTML5 using the Audio tag to achieve lyrics synchronization
The above is the detailed content of How to display audio styles that can be played and paused in html? (code example). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex
