css小案例(个人信息卡片)

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&nbsp&nbsp</div>
            <div>Followers</div>
          </div>
          <button class="follow-button">Follow</button>
        </div>
      </div>
    </div>
  </body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值