<!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. 深入刨析tomcat 之---第2篇,解决第3章bug 页面不显示内容http://localhost:8080/servlet/ModernServlet?userName=zhangyantao&password=1234

    writedby 张艳涛7月2日, 在学习第4张的过程中,发现了前一篇文章写的是关于1,2张的bug不用设置response响应头,需要在servlet的service()方法里面写是错误想 serv ...

  2. thinkphp 事物回滚

    1 $m=D('YourModel');//或者是M(); 2 $m2=D('YouModel2'); 3 $m->startTrans();//在第一个模型里启用就可以了,或者第二个也行 4 ...

  3. Matlab常用函数:二进制和十进制转换,均值,方差

    文章目录 Size s=size(A) [r,c]=size(A) [r,c,m]=size(A) size(A,n) 二进制和十进制转换 dec2bin mean 均值 mean(a,1) mean ...

  4. 关于vue3简单状态管理约定引发的思考

    官方文档的代码是这样的 export const store = { debug: true, state: reactive({ message: 'Hello!' }), setMessageAc ...

  5. PS Lite - 源码解读

    PostOffice 类 /** * \brief 系统的中心. */ class Postoffice { public: /** * \brief 返回单例对象. */ static Postof ...

  6. Hadoop 3.1.1 - 概述 - 集群安装

    Hadoop 集群安装 目标 本文描述了如何从少数节点到包含上千节点的大规模集群上安装和配置 Hadoop 集群.如果只是为了尝试,你可以先从单台机器上安装开始(参阅单节点安装). 本文并不包含诸如安 ...

  7. Linux的磁盘管理和进程管理(入门)

    查看磁盘使用情况 df :列出文件系统整体的磁盘使用量 增加-h参数可以使得显示的容量更人性化 du:检查磁盘空间使用量---需要进入文件中查看 挂载本地磁盘或文件 mount mount /dev/ ...

  8. Java基础——类型转换注意事项及常见问题

    类型转换 由于Java是强类型语言,所以要进行有些运算的时候,需要用类型转换 低------------------------------------------------------------ ...

  9. C++ 多态 案例(//多态案例----制作饮品 //描述:煮水 冲泡 倒入杯中 加入辅料)

    1 //多态案例----制作饮品 2 //描述:煮水 冲泡 倒入杯中 加入辅料 3 4 #include <iostream> 5 #include <string> 6 us ...

  10. Android面试大揭秘!从技术面被“虐”到征服CTO,全凭这份强到离谱的pdf

    在笔者面试这一个月,看了不少文章,也刷了不少面试题,但真正有深度,适合4年及以上Android高工的内容少之又少 在面试准备阶段,笔者准备了三个月左右的时间,结合相关资料及源码,完成了一系列的深度学习 ...