<!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>
</head> <body>
<div id="app">
<div class="button-test">
<div>哈哈哈哈</div>
<div>这是一段描述</div>
<div>===</div>
<div>访问网站</div>
</div>
<div class="button-test">
<div>哈哈哈哈</div>
<div>这是一段描述</div>
<div>===</div>
<div>访问网站</div>
</div>
<div class="button-test">
<div>哈哈哈哈</div>
<div>这是一段描述</div>
<div>===</div>
<div>访问网站</div>
</div>
</div>
</body> </html> <style>
:root {
--box-width: 200px;
--box-button-width: 100px;
} html,
body {
padding: 0;
margin: 0;
} #app {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
min-height: 100vh;
background-image: radial-gradient( circle 732px at -23.9% -25.1%, rgba(30,39,107,1) 6.1%, rgba(188,104,142,1) 100.2% );
} .button-test {
user-select: none;
display: flex;
flex-direction: column;
align-items: center;
transition: .3s ease-in-out;
width: var(--box-width);
height: var(--box-width);
margin: 10px;
border-radius: 10px;
color: #eee;
cursor: default;
background-color: rgba(255, 255, 255, .1);
} .button-test:hover {
transition: .3s ease-in-out;
backdrop-filter: blur(5px);
background-color: rgba(255, 255, 255, .2);
} .button-test div:nth-child(1) {
transition: .3s ease-in-out;
transform: translateY(100%);
font-size: 2rem;
} .button-test div:nth-child(2) {
opacity: 1;
transition: .3s ease-in-out;
font-size: .9rem;
transform: translateY(300%);
} .button-test div:nth-child(3) {
transition: .3s ease-in-out;
font-size: 3rem;
transform: translateY(80%);
} .button-test div:nth-child(4) {
font-size: .7rem;
border: solid 2px #999;
padding: 8px 20px;
text-align: center;
border-radius: 20px;
width: var(--box-button-width);
opacity: 0;
transform: translateY(100%);
transition: .3s ease-in-out;
cursor: pointer;
} .button-test:hover div:nth-child(1) {
transition: .2s ease-in-out;
transform: translateY(50%);
} .button-test:hover div:nth-child(2) {
transition: .2s ease-in-out;
opacity: 0;
transform: translateY(150%);
} .button-test:hover div:nth-child(3) {
transition: .4s ease-in-out;
opacity: 1;
transform: translateY(-5%);
} .button-test:hover div:nth-child(4) {
transition: .5s ease-in-out;
opacity: 1;
transform: translateY(50%);
}
</style>
哈哈哈哈
这是一段描述
===
访问网站

哈哈哈哈
这是一段描述
===
访问网站

哈哈哈哈
这是一段描述
===
访问网站

:root { --box-width: 200px; --box-button-width: 100px }
body { padding: 0; margin: 0 }
#app { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 100vh; background-image: radial-gradient(circle 732px at -23.9% -25.1%, rgba(30, 39, 107, 1) 6.1%, rgba(188, 104, 142, 1) 100.2%) }
.button-test { user-select: none; display: flex; flex-direction: column; align-items: center; transition: 0.3s ease-in-out; width: var(--box-width); height: var(--box-width); margin: 10px; border-radius: 10px; color: rgba(238, 238, 238, 1); cursor: default; background-color: rgba(255, 255, 255, 0.1) }
.button-test:hover { transition: 0.3s ease-in-out; backdrop-filter: blur(5px); background-color: rgba(255, 255, 255, 0.2) }
.button-test div:nth-child(0n+1) { transition: 0.3s ease-in-out; transform: translateY(100%); font-size: 2rem }
.button-test div:nth-child(0n+2) { opacity: 1; transition: 0.3s ease-in-out; font-size: 0.9rem; transform: translateY(300%) }
.button-test div:nth-child(0n+3) { transition: 0.3s ease-in-out; font-size: 3rem; transform: translateY(80%) }
.button-test div:nth-child(0n+4) { font-size: 0.7rem; border: 2px solid rgba(153, 153, 153, 1); padding: 8px 20px; text-align: center; border-radius: 20px; width: var(--box-button-width); opacity: 0; transform: translateY(100%); transition: 0.3s ease-in-out; cursor: pointer }
.button-test:hover div:nth-child(0n+1) { transition: 0.2s ease-in-out; transform: translateY(50%) }
.button-test:hover div:nth-child(0n+2) { transition: 0.2s ease-in-out; opacity: 0; transform: translateY(150%) }
.button-test:hover div:nth-child(0n+3) { transition: 0.4s ease-in-out; opacity: 1; transform: translateY(-5%) }
.button-test:hover div:nth-child(0n+4) { transition: 0.5s ease-in-out; opacity: 1; transform: translateY(50%) }

【CSS】模仿迅雷主页的按钮的更多相关文章

  1. [Windows Phone]模仿魔兽3技能按钮SkillButton

    简介: 模仿魔兽3技能按钮,带CD效果.使用的时候可以当做普通按钮使用,同时也支持Binding. 音效紧耦合在控件内部,因为控件本身目的就是模拟魔兽3的技能按钮,所以不考虑音效的扩展. Demo结构 ...

  2. 纯css实现checkbox开关切换按钮

    我们都知道 checkbox 标签默认样式 实在是太low了,故对CheckBox美化很有必要. 现提供两种方式对其进行美化. 方法一 <div class="switch-wrap ...

  3. css模仿微信弹出菜单

      css模仿微信弹出菜单 效果图: html: <div class="action-sheet-backdrop"> <div class="act ...

  4. 用CSS制作带图标的按钮

    先上一张效果图

  5. [CSS]Input标签与图片按钮对齐

    页面直接摆放一个input文本框与ImageButton图片按钮,但是发现没有对齐: <input type="text" id="txtQty" /&g ...

  6. div+css模仿登录界面

    我的代码,这种方式形成了遮罩层,遮罩层的"登录"按钮仍可被点击,非我想要的. <!DOCTYPE html> <html lang="en"& ...

  7. CSS自定义文件上传按钮

    今天一同事问我文件上传按钮的问题,情况是这样的,他页面上有3个按钮,分为左中右三个,左边的位按钮甲,右边的位按钮乙,而中间的就是个文件选择按钮,情况大概是这个样子的: 两边的按钮都有了样式,但中间的选 ...

  8. css中文本框与按钮对不齐解决方案

    我们先对对input标记设定样式,代码如下: html 代码 <form> <input type=”text” name=”text1” id=”text1” /> < ...

  9. CSS 文本框里添加按钮的实现

    有很多人做界面会经常发现设计师设计出这样的界面: 咋一看是一个文本框里加了一个按钮,经过谷歌之后,未发现在文本框里可以添加按钮. 但可以通过div来实现它. 我的做法是先做一个大小的div,然后用带里 ...

随机推荐

  1. #使用C#winform编写渗透测试工具--子域名挖掘

    使用C#winform编写渗透测试工具--子域名挖掘 这篇文章主要介绍使用C#winform编写渗透测试工具--子域名挖掘.在渗透测试中,子域名的收集十分重要,通常一个网站的主站的防御能力特别强,而他 ...

  2. webRTC的标准与发展

    Web实时通信(WebRTC)是标准,协议和JavaScript API的集合,两者的组合可实现浏览器(对等)之间的对等音频,视频和数据共享.WebRTC无需依赖第三方插件或专有软件,而是将实时通信转 ...

  3. Podman 快速入门

    今天在某云上新购一台云服务器,发现已经有了 CentOS8.2 官方镜像可选,出于对新鲜事物的好奇,我决定开始采用 CentOS8.2,即使我还没有为它的新特性做好准备. 我的应用主要以单机版容器为主 ...

  4. 「GM_脚本」获取 GitHub 项目文件的 jsDelivr CDN 地址「好像没啥用系列」

    基本信息: name:「 GitHub 」获取文件的 jsDelivr 地址 desc:获取项目文件的 CDN 地址 url: https://github.com/wdssmq/userscript ...

  5. 为ScrollView增加圆角的三种方式,及自定义属性【在Linearlayout中新增ScrollView支持滚动 后续】

    获取圆角的几种方案如下:方案一:通过shape来实现,给scrollView增加背景来实现方案二:通过自定义ScrollView,还要自定义属性,在dispatchDraw中不停的裁剪方案三:用And ...

  6. ERROR: database "db" is being accessed by other users

    执行DROP DATABASE testdb;的时候提示: ERROR: database "testdb" is being accessed by other users DE ...

  7. MFC对文件文件夹转移、删除、重命名、复制【转】

    HFileOperation()函数主要对文件夹有四种操作:复制,删除,移动,重命名. 写了四个函数.可以很好的对文件夹进行操作. //函数名:MoveFolder //参数:lpszFromPath ...

  8. Java on Visual Studio Code的更新 – 2021年7月

    Nick zhu, Senior Program Manager, Developer Division at Microsoft 大家好,欢迎来到 7 月版的 Visual Studio Code ...

  9. VMware 安装 Centos 7 虚拟机配置网络

    在 Windows 机器上如果想使用 Linux 环境,最方便的方式莫过于使用虚拟机,最常用的软件各位肯定也不陌生,大名鼎鼎的 VMware . 不过这玩意有点稍稍不是那么智能,每次安装 Linux ...

  10. 阿里三面Android开发岗都过了,但是无理由挂了,竟是HR骚操作?

    进入互联网大厂一般都是"过五关斩六将",难度堪比西天取经,但当你真正面对这些大厂的面试时,有时候又会被其中的神操作弄的很是蒙圈. 近日,某位程序员发帖称,自己去阿里面试Androi ...