html音乐播放器歌单
时间: 2023-12-19 11:31:04 浏览: 39
以下是一个简单的HTML音乐播放器歌单的例子:
```html
<!DOCTYPE html>
<html>
<head>
<title>Music Player</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
h1 {
text-align: center;
font-size: 36px;
margin-bottom: 20px;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
li {
display: flex;
align-items: center;
padding: 10px;
border-bottom: 1px solid #eee;
}
li:hover {
background-color: #f2f2f2;
}
li img {
width: 60px;
height: 60px;
margin-right: 10px;
}
li .fa-play-circle {
font-size: 24px;
color: #1db954;
margin-right: 10px;
cursor: pointer;
}
li .fa-play-circle:hover {
color: #1ed760;
}
li .title {
font-size: 18px;
font-weight: bold;
margin-bottom: 5px;
}
li .artist {
font-size: 14px;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<h1>My Music Playlist</h1>
<ul>
<li>
<img src="https://via.placeholder.com/60x60" alt="Album Cover">
<i class="fa fa-play-circle"></i>
<div>
<div class="title">Song Title</div>
<div class="artist">Artist Name</div>
</div>
</li>
<li>
<img src="https://via.placeholder.com/60x60" alt="Album Cover">
<i class="fa fa-play-circle"></i>
<div>
<div class="title">Song Title</div>
<div class="artist">Artist Name</div>
</div>
</li>
<li>
<img src="https://via.placeholder.com/60x60" alt="Album Cover">
<i class="fa fa-play-circle"></i>
<div>
<div class="title">Song Title</div>
<div class="artist">Artist Name</div>
</div>
</li>
</ul>
</div>
</body>
</html>
```
这个例子使用了HTML、CSS和FontAwesome图标库来创建一个简单的音乐播放器歌单。每个歌曲都有一个封面图片、歌曲标题和艺术家名称,并且可以通过点击播放按钮来播放歌曲。