AcWing
  • 首页
  • 活动
  • 题库
  • 竞赛
  • 商店
  • 应用
  • 文章
    • 题解
    • 分享
    • 问答
  • 吐槽
  • 登录/注册

Bilibili名片

作者: 作者的头像   半醒的狐狸 ,  2022-08-06 20:56:04 ,  所有人可见 ,  阅读 29


1


成果展示

a71ae90fad9d4763770627ab5f92a4a.jpg
CSS实战第二弹

html代码

<!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.css">
</head>

<body>
    <div class="user-card">
        <div class="user-card-head"></div>
        <div class="user-card-body">
            <div class="user-card-body-left">
                <img src="https://cdn.acwing.com/media/user/profile/photo/37532_lg_7bfbf0828a.jpg" alt="">
            </div>
            <div class="user-card-body-right">
                <div class="user-card-body-right-info">
                    <div class="user-card-body-right-info-username">
                        五星大酒店
                        <span style="font-size: 12px; color: aliceblue; background-color: orange;">LV5</span>
                    </div>
                    <div class="user-card-body-right-info-reputation">
                        <span class="user-card-body-right-info-reputation-item">
                            <span>229</span>
                            <span>关注</span>
                        </span>
                        <span class="user-card-body-right-info-reputation-item">
                            <span>6</span>
                            <span>粉丝</span>
                        </span>
                        <span class="user-card-body-right-info-reputation-item">
                            <span>3</span>
                            <span>获赞</span>
                        </span>
                    </div>
                </div>
                <div class="user-card-body-right-button">
                    <button>+关注</button>
                    <button>发消息</button>
                </div>
            </div>
        </div>


    </div>
</body>

</html>

css代码

.user-card {
    width: 366px;
    height: 215px;
    box-shadow: 2px 2px 5px lightgray;
    border-radius: 5px;
    overflow: hidden;
}

.user-card-head {
    background-image: url('/static/images/mountain.jpg');
    background-size: cover;
    width: 100%;
    height: 85px;
}

.user-card-body {
    width: 100%;
    height: calc(100% - 85px);
    box-sizing: border-box;
    padding-top: 12px;
}

.user-card-body-left {
    width: 70px;
    height: 100%;
    float: left;
    text-align: center;
}

.user-card-body-left>img {
    width: 48px;
    height: 48px;
    border-radius: 50%;

}

.user-card-body-right {
    width: calc(100% - 70px);
    height: 100%;
    float: left;

}

.user-card-body-right-info {
    width: 100%;
    height: 65%;
}

.user-card-body-right-info-username {
    padding-left: 10px;
    font-size: 16px;
    color: #18191C;
    font-weight: bold;
    margin-bottom: 10px;
}

.user-card-body-right-info-reputation {
    width: 276px;
    height: 18px;
    margin-left: 10px;
}

.user-card-body-right-info-reputation-item>span:nth-child(1) {
    font-size: 12px;
    color: #18191C;
}

.user-card-body-right-info-reputation-item>span:nth-child(2) {
    font-size: 12px;
    color: #9499A0;
    margin-left: 3px;
}

.user-card-body-right-button>button {
    width: 102px;
    height: 30px;
    border: none;
    border-radius: 5px;
    margin-right: 5px;
    cursor: pointer;
}

.user-card-body-right-button>button:nth-child(1) {
    background-color: #00a1d6;
    color: white;
}

.user-card-body-right-button>button:nth-child(1):hover {
    background-color: #00b5e5;
    transition: 400ms;
}

.user-card-body-right-button>button:nth-child(2) {
    background-color: white;
    border: #6d757a solid 1px;
}

.user-card-body-right-button>button:nth-child(2):hover {
    color: #00b5e5;
    border-color: #00b5e5;
    transition: 400ms;
}

md笔记

43efb8b91fe5f289be0b54bea7b6761.jpg

0 评论

你确定删除吗?

© 2018-2022 AcWing 版权所有  |  京ICP备17053197号-1
用户协议  |  常见问题  |  联系我们
AcWing
请输入登录信息
更多登录方式: 微信图标 qq图标
请输入绑定的邮箱地址
请输入注册信息