效果展示 http://127.0.0.1:5500/bilibili-mingpian.html
HTML
代码语言:javascript复制<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="/static/css/bilibili-mingpian.css">
<link rel="icon" href="/static/images/logo.png">
</head>
<body style="margin: 0">
<div class="user-card">
<div class="user-card-head"></div>
<div class="user-card-body">
<div class="user-card-body-left">
<a href="https://space.bilibili.com/431839336?spm_id_from=333.1007.0.0" target="_blink">
<img src="https://cdn.acwing.com/media/user/profile/photo/182747_lg_6101cfc4af.jpg" alt="">
</a>
</div>
<div class="user-card-body-right">
<div class="user-card-body-right-text">
<div class="user-card-body-right-text-username">
<a href="https://space.bilibili.com/431839336?spm_id_from=333.1007.0.0" target="_blink">
<span>偏执i北猫</span>
</a>
<span>Lv5</span>
</div>
<div class="user-card-body-right-text-reputation">
<span class="user-card-body-right-text-reputation-item">
<span>600</span>
<span>关注</span>
</span>
<span class="user-card-body-right-text-reputation-item">
<span>25</span>
<span>粉丝</span>
</span>
<span class="user-card-body-right-text-reputation-item">
<span>582</span>
<span>获赞</span>
</span>
</div>
<div class="user-card-body-right-text-info">
个人Django游戏网站 <a href="https://app2823.acapp.acwing.com.cn/" style="text-decoration: none;"
target="_blink">https://app2823.acapp.acwing.com.cn/</a>
(有待更新)
</div>
</div>
<div class="user-card-body-right-button">
<button> 关注</button>
<button>发信息</button>
</div>
</div>
</div>
</div>
</body>
</html>
CSS
代码语言:javascript复制.user-card {
width: 366px;
height: 257px;
margin: 100px auto;
/* background-color: aqua; */
box-shadow: 2px 2px 5px lightgray;
border-radius: 5px;
}
.user-card-head {
background-image: url('/static/images/mountain.jpg');
background-size: cover;
width: 100%;
height: 85px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.user-card-body {
width: 366px;
height: 172px;
}
.user-card-body-left {
width: 70px;
height: 100%;
float: left;
/* background-color: aqua; */
/* background-image: url('https://www.acwing.com/user/profile/index/');
background-size: cover;
width: 100%; */
}
.user-card-body-left img {
width: 48px;
height: 48px;
position: relative;
top: 12px;
left: 11px;
border-radius: 50%;
}
.user-card-body-right {
width: calc(100% - 70px);
height: 100%;
float: left;
/* background-color: brown; */
/* margin-left: 12px; */
}
.user-card-body-right-text {
width: 100%;
height: 60%;
margin-left: 12px;
}
.user-card-body-right-text-username {
/* font-size: 16px;
color: #222222;
font-weight: bold; */
margin: 12px 0 12px 0;
/* cursor: pointer; */
}
.user-card-body-right-text-username>a {
font-size: 16px;
color: #222222;
font-weight: bold;
margin: 0 5px 0 0;
text-decoration: none;
}
.user-card-body-right-text-username>span:nth-child(2) {
font-size: 12px;
color: #FB6A00;
font-style: italic;
}
.user-card-body-right-text-reputation {
/* padding-top: 18px;
box-sizing: border-box;
margin-left: 12px; */
cursor: pointer;
}
.user-card-body-right-text-reputation-item {
margin: 0 18px 0 0;
}
.user-card-body-right-text-reputation-item>span:nth-child(1) {
font-size: 12px;
color: #18191C;
}
.user-card-body-right-text-reputation-item>span:nth-child(2) {
font-size: 12px;
color: #9499A0;
margin: 0 0 0 3px;
}
.user-card-body-right-text-info {
margin-top: 5px;
font-size: 12px;
}
.user-card-body-right-button>button {
width: 102px;
height: 30px;
border: none;
border-radius: 5px;
margin: 12px;
position: relative;
top: 1px;
cursor: pointer;
}
.user-card-body-right-button>button:nth-child(1) {
background-color: #00B5E5;
margin-right: 8px;
color: white;
}
.user-card-body-right-button>button:nth-child(1):hover {
background-color: #00A1D6;
transition: 700ms;
}
.user-card-body-right-button>button:nth-child(2) {
background-color: white;
border: #6D757A solid 1px;
color: #6D757A;
}
.user-card-body-right-button>button:nth-child(2):hover {
border-color: #00B5E5;
color: #00B5E5;
transform: 1000ms;
}