CSS实战项目个人名片设计(StackOverflow个人名片实现)

Web应用课 CSS实战项目个人名片设计(StackOverflow个人名片实现)

StackOverflow网址:stack overflow

效果图:

在这里插入图片描述

实现步骤:

1.画出基本框架

在这里插入图片描述

2.写出基本实现框架

在这里插入图片描述

3.按照逻辑编写html文件

用到的标签有 <link><div><span><img><a>

想了解的可参考我写的html小结:

代码见最终代码展示

4.按结构图编写css文件:

使用 shift + ctrl + c , 可以看见名片元素标签的各项属性
在这里插入图片描述

根据各项属性设置结构中的标签即可。

最终代码展示:

html代码如下:

<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="static/css/style.css">
</head>

<body>
    <div class="user-card">
        <div class="user-card-head">
            asked Feb 9, 2019 at 18:18
        </div>
        <div class="user-card-body">
            <div class="user-card-body-photo">
                <a href="https://www.acwing.com/user/myspace/index/273995/" target="_blank">
                    <img src="static/images/touxiang.webp" alt="哆啦B梦">
                </a>
            </div>
            <div class="user-card-body-info">
                <div class="user-card-body-info-username">
                    <a href="https://www.acwing.com/user/myspace/index/273995/" target="_blank">Pigwantofly</a>
                </div>
                <div class="user-card-body-info-reputation">
                    <span style="color: #6A737C; font-weight: bold;">1,025</span>
                    <div class="user-card-body-info-reputation-item" style="background-color: #FFCC01;"></div>
                    3
                    <div class="user-card-body-info-reputation-item" style="background-color: #b4b8bc;"></div>
                    14
                    <div class="user-card-body-info-reputation-item" style="background-color: #d1a684;"></div>
                    25
                </div>
            </div>
        </div>
    </div>
</body>

</html>

css代码如下:

.user-card-body-photo img {
    width: 32px;
    height: 32px;
    border-radius: 3px;
}

.user-card {
    width: 200px;
    height: 67.69px;
    background-color: #D9EAF7;
    margin: 100px auto;
    box-sizing: border-box;
    padding: 5px 6px 7px 7px;
    border-radius: 5px;
    border-style: solid;
    border-color: aqua;
}

.user-card-head {
    font-size: 12px;
    color: #6A737C;
    margin: 1px 0px 4px 0px;
    box-sizing: border-box;
}

.user-card-body-photo {
    float: left;
}

.user-card-body-info {
    float: left;
    margin-left: 8px;
}

.user-card-body-info-username {
    height: 14px;
    line-height: 14px;
    margin-bottom: 4px;
}

.user-card-body-info-username > a {
    font-size: 13px;
    color: #0074CC;
    text-decoration: none;
}

.user-card-body-info-reputation {
    font-size: 12px;
    color: #838C95;
    height: 14px;
    line-height: 14px;
}

.user-card-body-info-reputation-item {
    width: 6px;
    height: 6px;
    display: inline-block;
    border-radius: 50%;
    margin: 0px 3px 0px 2px;
    position: relative;
    top: -2px;
}

还有一个B站名片实战,过段时间发

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Pigwantofly

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值