仿stackoverflow名片与b站名片实现(HTML、CSS)

目录

  • 前言
  • 一、仿stackoverflow名片
    • HTML
    • CSS
  • 二、仿b站名片
    • HTML
    • CSS
  • 素材


前言

学习自ACwing - Web应用课

一、仿stackoverflow名片

在这里插入图片描述

HTML

<!DOCTYPE html>
<html lang="en"><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 Aug 3, 2022 at 2:30</div><div class="user-card-body"><div class="user-card-body-photo"><a href="https://blog.csdn.net/qq_37397652?type=blog" target="_blank"><img src="static/images/head.jpeg" alt=""></a></div><div class="user-card-body-info"><div class="user-card-body-info-username"><a href="https://blog.csdn.net/qq_37397652?type=blog" target="_blank"style="text-decoration: none; color: #1B75D0;">Kinno</a></div><div class="user-card-body-info-reputation"><span style="font-weight: bold;">1,024</span><div class="user-card-body-info-reputation-item" style="background-color: #f7ce46;"></div>3<div class="user-card-body-info-reputation-item" style="background-color: #b5b8bc;"></div>14<div class="user-card-body-info-reputation-item" style="background-color: #caa889;"></div>25</div></div></div></div>
</body></html>

CSS

.user-card-body-photo img {width: 32px;height: 32px;border-radius: 4px;
}.user-card {width: 200px;height: 67.19px;background-color: #eef5fc;margin: 100px auto;padding: 5px 6px 7px 7px;box-sizing: border-box;
}.user-card-head {font-size: 12px;color: #636B74;margin-top: 1px;margin-bottom: 4px;
}.user-card-body-info-username {font-size: 11px;height: 16px;/* text-decoration: none; */line-height: 16px;/*让字上下居中*/
}.user-card-body-info-reputation {font-size: 12px;color: #636B74;height: 16px;line-height: 16px;
}.user-card-body-photo {float: left;
}.user-card-body-info {float: left;margin-left: 8px;
}.user-card-body-info-reputation-item {width: 6px;height: 6px;display: inline-block;border-radius: 50%;margin-left: 2px;margin-right: 3px;position: relative;top: -2px;
}

二、仿b站名片

在这里插入图片描述

HTML

<!DOCTYPE html>
<html lang="en"><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/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="/static/images/head.jpeg" alt="head-photo"></div><div class="user-card-body-right"><div class="user-card-body-right-info"><div class="user-card-body-right-text"><div class="user-card-body-right-text-username"><a href="#" style="text-decoration: none;">Kinno喵喵</a><i><img src="/static/images/6-level.png" alt="6-level" style="width: 17.8px;"></i></div></div><div class="user-card-body-right-text-reputation"><div class="user-card-body-right-text-reputation-item"><span style="color: rgb(24, 25, 28);">304</span><span style="color: rgb(148, 153, 160); margin-left: 3px;">关注</span></div><div class="user-card-body-right-text-reputation-item"><span>8</span><span style="color: rgb(148, 153, 160); margin-left: 3px;">粉丝</span></div><div class="user-card-body-right-text-reputation-item"><span>8</span><span style="color: rgb(148, 153, 160); margin-left: 3px;">获赞</span></div></div><div class="user-card-body-right-button"><button>+ 关注</button><button>发消息</button></div></div></div></div></div>
</body></html>

CSS

.user-card {width: 366px;height: 220px;box-shadow: 2px 2px 5px lightgray;border-radius: 5px;
}.user-card-head {background-image: url(/static/images/bilibili-background.png);background-size: cover;width: 100%;height: 85px;
}.user-card-body-right {width: 366px;height: 134px;padding: 12px 20px 16px 70px;box-sizing: border-box;
}.user-card-body-right-info {display: flex;flex-direction: column;
}.user-card-body-left {width: 70px;height: 48px;float: left;margin-top: 10px;display: flex;justify-content: center;/* 水平居中 */align-items: center;/* 垂直居中 */
}.user-card-body-left img {width: 48px;height: 48px;border-radius: 50%;
}.user-card-body-right-text-username {margin-bottom: 10px;width: 276px;height: 30px;
}.user-card-body-right-text-username a {line-height: 30px;font-size: 16px;font-weight: 600;color: rgb(24, 25, 28);display: inline-block;/* 设置为inline-block,以支持高度和垂直对齐 */vertical-align: middle;/* 与图标垂直居中对齐 */
}.user-card-body-right-text-username i {width: 30px;height: 30px;margin-left: 5px;
}.user-card-body-right-text-reputation {width: 276px;height: 18px;font-size: 12px;line-height: 18px;font-weight: 400;display: flex;
}.user-card-body-right-text-reputation-item {margin-right: 18px;display: inline-block;text-size-adjust: 100%;display: flex;
}.user-card-body-right-button {margin-top: 16px;width: 276px;height: 32px;
}.user-card-body-right-button button {width: 100px;height: 30px;font-size: 14px;border: none;border-radius: 5px;cursor: pointer;
}.user-card-body-right-button button:nth-child(1) {background-color: #00AEEC;color: white;margin-right: 8px;
}.user-card-body-right-button button:nth-child(1):hover {background-color: #43c3f2;transition: 500ms;
}.user-card-body-right-button button:nth-child(2) {background-color: white;border: rgb(201, 204, 208) solid 1px;color: rgb(97, 102, 109);
}.user-card-body-right-button button:nth-child(2):hover {border-color: #00AEEC;color: #00AEEC;transition: 500ms;
}

素材

  • b站名片背景:
    b站名片背景
  • 头像:
    在这里插入图片描述
  • b站level6:
    在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/336002.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【QML COOK】- 005-粒子系统(ParticleSystem)

1. 编辑main.qml import QtQuick import QtQuick.ParticlesWindow {width: 800height: 800visible: truetitle: qsTr("Hello World")color: "#000000"MouseArea {id: mouseAreaanchors.fill: parentonClicked: {hahaEmitter.pulse(2000)}}ParticleSystem {…

Java--业务场景:在Spring项目启动时加载Java枚举类到Redis中(补充)

文章目录 前言步骤测试结果 前言 通过Java–业务场景&#xff1a;在Spring项目启动时加载Java枚举类到Redis中,我们成功将Java项目里的枚举类加载到Redis中了&#xff0c;接下来我们只需要写接口获取需要的枚举值数据就可以了&#xff0c;下面一起来编写这个接口吧。 步骤 在…

怎样在Anaconda下安装pytorch(conda安装和pip安装)

前言 文字说明 本文中标红的&#xff0c;代表的是我认为比较重要的。 版本说明 python环境配置&#xff1a;jupyter的base环境下的python是3.10版本。CUDA配置是&#xff1a;CUDA11.6。目前pytorch官网提示支持的版本是3.7-3.9 本文主要用来记录自己在安装pytorch中出现的问…

Python3从零基础到入门(2)—— 运算符

目录 一、算术运算符 1.四则运算符 &#xff08;1&#xff09;加 &#xff08;2&#xff09;减 &#xff08;3&#xff09;乘 &#xff08;4&#xff09;除 2.取模 3.幂 4.取整除 二、关系运算符 1.等于关系运算符 2.不等于关系运算符 3.大于关系运算符 4.小于关…

GitLab clone 地址 不对

1丶问题描述 2丶解决方案 解决方案&#xff1a; 找到挂载到宿主机配置文件&#xff1a;gitlab.rb vi gitlab.rb 改成自己的ip 重启容器 docker restart gitlab 如果发现容器一直重启&#xff0c;可采用粗暴的方法&#xff0c;直接干掉当前容器&#xff0c;重新运行一个 …

知识点整理[(GraphGeo) DATA AND PROBLEM DEFINITION]

3 DATA AND PROBLEM DEFINITION 3.1 Data Collection 问题一:IP定位数据集构成 回答: 包含数以百万计的IP地址,这些IP地址包括: (1)它们具有自己的知识(如自主系统(AS)和WHOIS数据); (2)网络测量

第一次面试总结 - 迈瑞医疗 - 软件测试

&#x1f9f8;欢迎来到dream_ready的博客&#xff0c;&#x1f4dc;相信您对专栏 “本人真实面经” 很感兴趣o (ˉ▽ˉ&#xff1b;) 专栏 —— 本人真实面经&#xff0c;更多真实面试经验&#xff0c;中大厂面试总结等您挖掘 注&#xff1a;此次面经全靠小嘴八八&#xff0c;没…

多模态+SNN个人学习历程和心得

祖传开头 这次想写一个一直深藏心中的研究方向&#xff0c;那就是多模态方向。其实当初在实验室那会儿&#xff0c;最先接触的就是多模态的工作&#xff0c;因此这是我科研之路的起点。只不过&#xff0c;后来经历了一些波折&#xff0c;导致个人没有往这个方向深挖&#xff0…

2024年01月微软更新Bug 已解决 !Explorer.EXE 提示:Windows无法访问指定设备、路径或文件。你可能没有适当的权限访问该项目。

前倾概要 近期大量出现如上图问题&#xff0c;杀毒&#xff0c;系统急救箱都没反应&#xff0c;罪魁祸首就是微软更新&#xff01; 点击什么都是&#xff1a;Windows无法访问指定设备、路径或文件。你可能没有适当的权限访问该项目。 但软件使用正常&#xff0c;还能通过建立…

2024年1月9日学习总结

目录 学习目标学习内容联邦学习基础&#xff1a;why, what, howwhy&#xff1f;what&#xff1f;how&#xff1f; 联邦学习的例子——CIFAR-10数据集&#xff08;分类问题&#xff09;1、import libararies2、hyper-parameters3、加载并且划分数据4、创建神经网络模型5、helper…

PyTorch的Dataset 和TorchData API的比较

深度神经网络需要很长时间来训练。训练速度受模型的复杂性、批大小、GPU、训练数据集的大小等因素的影响。 在PyTorch中&#xff0c;torch.utils.data.Dataset和torch.utils.data.DataLoader通常用于加载数据集和生成批处理。但是从版本1.11开始&#xff0c;PyTorch引入了Torc…

数 据 分 析 1

1.使用Wireshark查看并分析靶机桌面下的capture.pcapng数据包文件&#xff0c;找到黑客的IP地址&#xff0c;并将黑客的IP地址作为Flag值&#xff08;如&#xff1a;172.16.1.1&#xff09;提交&#xff1b;172.16.1.41 查找&#xff1a;tcp.connection.syn 2.继续分析captu…