1、效果展示
2、代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
.card {
width: 500px;
height: 210px;
background-color: #fffaf2;
padding: 30px;
border-radius: 20px;
/* x 偏移量 | y 偏移量 | 阴影模糊半径 | 阴影颜色 */
box-shadow: 0px 5px 10px #d4d4d4;
display: flex;
justify-content: space-between;
}
.card-left {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.photo img {
width: 80px;
height: 80px;
}
.connect-box {
width: 180px;
height: 40px;
display: flex;
justify-content: space-between;
}
.connect-box div {
width: 36px;
height: 36px;
background-color: #ffffff;
border: solid 1px #e7e7e7;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.connect-box div img {
width: 25px;
height: 25px;
margin: auto;
}
.card-right {
width: 260px;
height: 200px;
padding-top: 40px;
padding-bottom: 40px;
}
.or-text {
display: flex;
justify-content: space-between;
color: gray;
font-size: 13px;
}
.or-text img {
width: 20px;
height: 20px;
}
.proress-bar {
width: 100%;
height: 8px;
border-radius: 4px;
overflow: hidden;
background-color: #dfdfdf;
margin-top: 10px;
}
.proress-bar .progress {
width: 80%;
height: 100px;
background-color: #f17938;
}
.follow-box {
display: flex;
flex-direction: column;
align-items: flex-end;
margin-top: 50px;
}
.follow-box .followers-box {
width: 100%;
display: flex;
justify-content: flex-end;
font-size: 15px;
margin-bottom: 10px;
}
.follow-button {
width: 119px;
height: 30px;
border: 0;
outline: none;
border-radius: 6px;
background-color: #13143b;
color: white;
}
.connect-box div:hover {
transform: scale(1.05);
border: solid 1px #b3b3b3;
}
.follow-button:hover {
transform: scale(1.05);
}
</style>
</head>
<body style="background-color: #dfdfdf">
<div class="card">
<div class="card-left">
<div class="photo"><img src="img/photo.png" alt="头像加载失败" /></div>
<div class="name" style="font-weight: 700">Smelly Cat</div>
<div class="ID" style="font-size: 13px">@www0917</div>
<div class="intro" style="font-size: 13px">
Thank you for being my friends
</div>
<div class="connect-box">
<div><img src="img/github.png" alt="" class="connect-img" /></div>
<div><img src="img/wechat.png" alt="" class="connect-img" /></div>
<div><img src="img/youxiang.png" alt="" class="connect-img" /></div>
<div><img src="img/dianhua.png" alt="" class="connect-img" /></div>
</div>
</div>
<div class="card-right">
<div class="organization-box">
<div class="or-text">
<div>8/10 Organizations</div>
<img src="img/xiangqing.png" alt="" />
</div>
<div class="proress-bar">
<div class="progress"></div>
</div>
</div>
<div class="follow-box">
<div class="followers-box">
<div style="font-weight: 700">6K  </div>
<div>Followers</div>
</div>
<button class="follow-button">Follow</button>
</div>
</div>
</div>
</body>
</html>