<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Audio Player</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f2f5;
}
.audio-player {
max-width: 600px;
width: 100%;
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.audio-player audio {
width: 100%;
}
.audio-player h2 {
margin: 0;
font-size: 1.5em;
text-align: center;
}
</style>
</head>
<body>
<div class="audio-player">
<h2>Audio Player</h2>
<audio controls>
<source src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" type="audio/mp3">
Your browser does not support the audio element.
</audio>
</div>
</body>
</html>
标签:播放器,box,center,width,color,音频,player,audio
From: https://blog.51cto.com/u_16213142/12038957