制作蔡徐坤html+css偶像界面代码
时间: 2023-10-04 15:09:21 浏览: 384
以下是一个简单的蔡徐坤偶像界面的 HTML 和 CSS 代码示例:
HTML 代码:
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>蔡徐坤个人网站</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header">
<h1>蔡徐坤</h1>
<nav>
<ul>
<li><a href="#">首页</a></li>
<li><a href="#">音乐</a></li>
<li><a href="#">视频</a></li>
<li><a href="#">资讯</a></li>
</ul>
</nav>
</div>
<div class="banner">
<img src="https://i.loli.net/2021/09/09/XH6n3t2s9fZcYKv.png" alt="蔡徐坤">
</div>
<div class="content">
<h2>蔡徐坤简介</h2>
<p>蔡徐坤,1998年8月2日出生于湖南省长沙市,中国内地男歌手、演员、舞者。2014年,蔡徐坤在全国舞蹈比赛《中华舞蹈大赛》中获得全国总冠军。2016年,参加选秀节目《燃烧吧少年》获得冠军。2017年,以练习生身份参加选秀节目《偶像练习生》。</p>
<h2>蔡徐坤作品</h2>
<ul>
<li><a href="#">1. 《No Exception》</a></li>
<li><a href="#">2. 《You Can Be My Girl》</a></li>
<li><a href="#">3. 《Wait Wait Wait》</a></li>
<li><a href="#">4. 《I Wanna Get Love》</a></li>
</ul>
</div>
<div class="footer">
<p>© 2021 蔡徐坤个人网站</p>
</div>
</body>
</html>
```
CSS 代码:
```
/* 全局样式 */
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
/* 头部样式 */
.header {
background-color: #333;
color: #fff;
padding: 10px;
}
.header h1 {
margin: 0;
font-size: 32px;
}
.header nav ul {
margin: 0;
padding: 0;
list-style: none;
}
.header nav ul li {
display: inline-block;
}
.header nav ul li a {
display: block;
padding: 10px 20px;
color: #fff;
text-decoration: none;
}
.header nav ul li a:hover {
background-color: #555;
}
/* 横幅样式 */
.banner img {
display: block;
margin: 0 auto;
max-width: 100%;
height: auto;
}
/* 内容样式 */
.content {
padding: 20px;
}
.content h2 {
margin-top: 0;
}
.content ul {
margin: 0;
padding: 0;
list-style: none;
}
.content ul li {
margin-bottom: 10px;
}
.content ul li a {
color: #333;
text-decoration: none;
}
.content ul li a:hover {
text-decoration: underline;
}
/* 底部样式 */
.footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 10px;
}
```
你可以将上述代码保存为 `index.html` 和 `style.css` 文件,然后在浏览器中打开 `index.html` 文件,查看效果。
阅读全文
相关推荐

















