仿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.mzph.cn/news/622939.shtml

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

相关文章

BDD(Behavior-Driven Development)行为驱动开发介绍

为什么需要BDD&#xff1f; “开发软件系统最困难的部分就是准确说明开发什么” (“The hardest single part of building a software system is deciding precisely what to build” — No Silver Bullet, Fred Brooks) 。 看一下下面的开发场景&#xff1a; 场景一&#xf…

生成随机id

在Node.js中&#xff0c;你可以使用uuid模块来生成随机的ID。uuid模块提供了多种生成唯一标识符的方法&#xff0c;包括基于时间戳、随机数等不同的算法。 以下是一个简单的示例&#xff0c;演示如何在Node.js中使用uuid模块生成随机ID&#xff1a; 首先&#xff0c;你需 np…

基于TCP的全双工网络编程实践

首先我们先了解一下什么是全双工通信&#xff1f; 全双工数据通信允许数据同时在两个方向上传输&#xff0c;因此&#xff0c;全双工通信相当于是两个单工通信方式的结合&#xff0c;它要求发送设备和接收设备都有独立的接收和发送能力。 TCP服务端代码&#xff1a; #includ…

M-VAE

Word2Vec c(y) 辅助信息 作者未提供代码

音频和视频基础知识

声音 什么是声音&#xff1a; 声音是由物体振动产生的&#xff0c;物体发生振动&#xff0c;对周围的空气产生挤压&#xff0c;从而产生声音。声音是一种压力波&#xff0c;使周围的空气产生疏密变化&#xff0c;形成疏密相间的纵波&#xff0c;由此产生了声波。 声波三要素&…

小程序跳转安卓会跳转两次 iOS不会的解决方案

原因&#xff1a;元素点击事件在子元素上有绑定&#xff0c;父元素上也有绑定会形成冒泡事件&#xff1b; 原生小程序&#xff1a; bind:tap&#xff1a;会冒泡&#xff1b; <view bind:tap"gotoDetail"><image :src"{{ item2.img }}" mode&qu…

HUAWEI华为MateStation S台式机电脑12代PUC-H7621N,H5621N原装出厂Windows11.22H2系统

链接&#xff1a;https://pan.baidu.com/s/1QtjLyGTwMZgYiBO5bUVPYg?pwd8mx0 提取码&#xff1a;8mx0 原厂WIN11系统自带所有驱动、出厂主题壁纸、系统属性专属联机支持标志、Office办公软件、华为电脑管家等预装程序 文件格式&#xff1a;esd/wim/swm 安装方式&#xf…

dbeaver连接人大金仓报错 can‘t load driver class ‘com.kingbase8.Driver;‘

dbeaver可以连接很多数据库&#xff0c;设置dbeaver连接人大金仓&#xff0c;下载安装完成后&#xff0c;需要自行配置人大金仓的驱动&#xff0c;否则无法连接数据库。 一、dbeaver 下载 dbeaver 下载地址&#xff1a;https://dbeaver.io/download/ 二、查找人大金仓驱动 首…

[含完整代码]Linux使用.sh脚本自动部署(启动|停止|状态|日志)项目[超详细]

前言&#xff1a; 个人博客&#xff1a;www.wdcdbd.com 我们在linux部署.jar项目时&#xff0c;都需要通过java -jar的形式来部署&#xff0c;每次都要手动停止&#xff0c;部署&#xff0c;这样用起来会很麻烦。所以&#xff0c;这篇文章就是自己通过.sh脚本一键启动&#xf…

XCTF:hello_pwn[WriteUP]

使用checksec查看ELF文件信息 checksec 4f2f44c9471d4dc2b59768779e378282 这里只需要注意两个重点&#xff1a; Arch&#xff1a;64bit的文件&#xff0c;后面写exp的重点 Stack&#xff1a;No canary found 没有栈溢出保护 使用IDA对ELF文件进行反汇编 双击左侧的函数栏…

库函数点亮Led

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、pandas是什么&#xff1f;二、使用步骤 1.引入库2.读入数据总结 前言 提示&#xff1a;这里可以添加本文要记录的大概内容&#xff1a; 例如&#xff1a;…

陶瓷碗口缺口检测-图像分割

图像分割 由于对碗口进行缺口检测&#xff0c;因此只需要碗口的边界信息。得到陶瓷碗区域填充后的图像&#xff0c;对图像进行边缘检测。这是属于图像分割中的内容&#xff0c;在图像的边缘中&#xff0c;可以利用导数算子对数字图像求差分&#xff0c;将边缘提取出来。 本案…

【算法刷题】总结规律 算法题目第2讲 [234] 回文链表,因为深浅拷贝引出的bug

配合b站视频讲解食用更佳:https://www.bilibili.com/video/BV1vW4y1P7V7 核心提示&#xff1a;好几道题是处理有序数组的&#xff01; 适合人群&#xff1a;考研/复试/面试 解决痛点&#xff1a;1. 刷了就忘 2.换一道相似的题就不会 学完后会输出&#xff1a;对每类题目的框架…

test-04-test case generate 测试用例生成 tcases A model-based test case generator

拓展阅读 junit5 系列 基于 junit5 实现 junitperf 源码分析 Auto generate mock data for java test.(便于 Java 测试自动生成对象信息) Junit performance rely on junit5 and jdk8.(java 性能测试框架。性能测试。压测。测试报告生成。) 自动生成测试用例 Tcases&#xf…

查看lucene和elasticsearch的版本对应关系

一、Maven仓库官网&#xff1a; https://mvnrepository.com/ 二、搜索elasticsearch&#xff0c;然后点击Server或者elasticsearch进入。 三、点击相应的版本号进入。 四、查看对应的lucene版本。 END

spring cloud feign介绍以及和dubbo对比

什么是feign 在微服务架构中&#xff0c;Feign 是一个声明式的 web 服务客户端&#xff0c;它使得编写 web 服务客户端变得更加容易。Feign 旨在帮助开发者轻松地调用远程服务。它是由 Netflix 开发的一部分 Spring Cloud Netflix 微服务套件。Feign 通过提供一个简洁的模板化…

SwiftUI CoreData Picker

开发多账本功能 CoreData 与 Picker 的使用 上代码&#xff1a; // // TestZhangBenPicker.swift // pandabill // // Created by 朱洪苇 on 2024/1/14. //import SwiftUIstruct TestZhangBenPicker: View {FetchRequest(sortDescriptors: [SortDescriptor(\.cc_at)],anima…

JavaWeb,JavaScript的学习(上)

由于是JavaWeb的学习&#xff0c;是建立在已经学过Java的基础上。所以很多地方与Java做对比&#xff0c;然后没有把多余的内容详细写出来。 JS的引入方式 内嵌式 在head中通过一对script标签定义脚本代码 例&#xff1a; <!DOCTYPE html> <html lang"en&quo…

VMware迁移虚拟机教程,适用于换电脑、重装系统

新购入了一台电脑&#xff0c;接下来可能会有连续好多篇与装机/重装系统/装软件有关的文章&#xff0c;平时可能只是纸上谈兵&#xff0c;这次是花重金买素材了&#xff0c;建议收藏 问题背景&#xff1a;在之前的电脑上&#xff0c;安装了VMware Workstation&#xff0c;并配…

Python中魔术方法汇总

文章目录 1. Python中魔术方法的定义2. 魔术方法的分类2.1面向对象特性的增强&#xff1a;2.2运算符重载&#xff1a;2.3语义化编程&#xff1a;2.4控制对象生命周期&#xff1a;2.5容器协议支持&#xff1a;2.6 上下文管理器协议&#xff1a;2.7简化API设计&#xff1a; 3. 部…