歌手详情页面html、css
时间: 2023-08-14 08:06:02 浏览: 149
以下是一个简单的歌手详情页面的HTML和CSS示例:
HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>歌手详情页面</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<h1>歌手详情页面</h1>
</header>
<main>
<section id="artist-info">
<h2>歌手信息</h2>
<img src="https://via.placeholder.com/150" alt="歌手头像">
<h3>歌手名</h3>
<p>歌手简介</p>
</section>
<section id="album-list">
<h2>专辑列表</h2>
<ul>
<li>
<a href="#">
<img src="https://via.placeholder.com/150" alt="专辑封面">
<h3>专辑名</h3>
</a>
</li>
<li>
<a href="#">
<img src="https://via.placeholder.com/150" alt="专辑封面">
<h3>专辑名</h3>
</a>
</li>
<li>
<a href="#">
<img src="https://via.placeholder.com/150" alt="专辑封面">
<h3>专辑名</h3>
</a>
</li>
</ul>
</section>
</main>
<footer>
<p>版权信息</p>
</footer>
</body>
</html>
```
CSS代码:
```css
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: #fff;
padding: 20px;
}
h1 {
margin: 0;
}
main {
max-width: 800px;
margin: 20px auto;
padding: 0 20px;
}
section {
margin-bottom: 40px;
}
img {
display: block;
margin: 0 auto;
max-width: 100%;
}
h2 {
font-size: 24px;
margin-bottom: 20px;
}
h3 {
font-size: 18px;
margin: 10px 0;
}
p {
line-height: 1.5;
}
ul {
margin: 0;
padding: 0;
list-style: none;
display: flex;
flex-wrap: wrap;
}
li {
flex: 1 1 300px;
margin-right: 20px;
margin-bottom: 20px;
}
a {
display: block;
text-align: center;
color: #333;
text-decoration: none;
}
a:hover {
color: #666;
}
@media (max-width: 600px) {
li {
flex-basis: calc(50% - 10px);
}
}
```
这个页面包括一个页面标题、歌手信息、专辑列表和版权信息。使用了简单的HTML语义化标签和CSS样式。该页面响应式设计,适应不同的屏幕大小和设备。