CSS hover box
CSS hover box
transition 踩坑指南, display: none; 作为初始状态,不会产生动画效果,必须设置 height: 0; 或 width: 0; 来实现隐藏!
transition
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
position: relative;
}
ul {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
width: 50vw;
margin: 0 auto;
background: #fff;
border: 1px solid red;
padding: 10px;
}
ul>li {
list-style: none;
width: 100px;
height: 30px;
background: #ccc;
color: #0f0;
text-align: center;
/* text-decoration: underline; */
}
a{
text-decoration: none;
}
.link {
color: #f0f;
}
.link:hover{
color: #0f0;
}
.link + .hover-box,
.hover-box {
position: fixed;
display: block;
/* display: none; */
/* visibility: hidden; */
height: 0;
width: calc(100vw);
background: #000;
color: #fff;
top: 80px;
left: 0;
right: 0;
/* margin-top: 100px; */
overflow: hidden;
margin: 0;
padding: 0;
// transition: height 2s .5s ease-in-out;
transition: height 2s .5s ease-out;
}
/* .hover-box > p {
height: 0;
} */
.link:hover + .hover-box,
.hover-box:hover {
transition: height 2s .5s ease-in;
height: 200px;
// animation: hover-animation 2s .5s ease-in-out;
// padding: 30px;
// transition:
// height 2s .5s ease-in-out,
// padding-top 2s .5s ease-in-out,
// padding-bottom 2s .5s ease-in-out;
}
/* .hover-box:hover > p {
height: auto;
} */
/* .link:hover + .hover-box,
.hover-box:hover {
width: calc(100vw);
height: 200px;
background: #000;
transition: height 1s .5s ease-in-out;
color: #fff;
padding: 30px;
} */
/* animation: 2s linear hover-animation 1s; */
/* animation-name, animation-duration, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, animation-fill-mode, animation-play-state. */
@keyframes hover-animation {
0% {
height: 0px;
}
25% {
height: 25px;
}
50% {
height: 50px;
}
75% {
height: 75px;
}
100% {
height: 100px;
}
}
demo
See the Pen hover box by xgqfrms
(@xgqfrms) on CodePen.
animate.css
https://github.com/animate-css/animate.css
refs
https://codepen.io/xgqfrms/pen/NWRaXoN
https://codepen.io/xgqfrms/pen/LYRzqZq
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
CSS hover box的更多相关文章
- css:hover状态改变另一个元素样式的使用
效果演示 css:hover状态改变另一个元素样式的使用 .box { width: 150px; height: 150px; background-color: #069; line-height ...
- 【笔记】css hover 伪类控制其他元素
最近在模仿一个网站的项目 当中有一个效果需要利用到hover效果因为不太想写jq脚本所以百度了一下css hover的运用发现原来hover也可以控制其他元素的变化的 但是这有一个要求 就是添加hov ...
- CSS active选择器与CSS hover选择器
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8& ...
- CSS hover
CSS hover hover 鼠标移动到当前标签上时,以下css属性才能生效 <!DOCTYPE html> <html lang="en"> <h ...
- 10个CSS+HOVER 的创意按钮
CSS hover 样式很简单,但是想创造出有意思.实用.有创意性的特效是很考验设计师的创意能力,所以设计达人每隔一段时间都会分享一些与鼠标点击.悬停的相关特效,以便大家获得更好的创造灵感. 今天我们 ...
- css hover伪类选择器与JQuery hover()方法
css hover伪类选择器 它属于anchor伪类 在支持 CSS 的浏览器中,<a>标签链接的不同状态都可以以不同的方式显示,常常用来改链接的颜色效果 实例 a:link {color ...
- css 3d box 实现的一些注意事项
Test1.html <!DOCTYPE html> <html lang="en"> <head> <meta charset=&quo ...
- css hover 动画 transition:background-color 0.2s,color 0.2s; 外层套内层,正常是 里外层 鼠标上来 外层有hover,如果就想到里层hover触发外层hover,要用外层position 定义绝对定位,内层的hover跳出外层的div,这样视觉上就是两个单独的div,进行内外层联动。
css hover 动画 transition:background-color 0.2s,color 0.2s; 外层套内层,正常是 里外层 鼠标上来 外层有hover,如果就想到里层hover触发 ...
- css hover对其包含的元素进行样式设置
<ul class="icon-down-single-arr-li"> <li> <a href="javascript:void(0)& ...
随机推荐
- nginx.service: control process exited, code=exited status=1
安装linux的宝塔面板,结果面板显示nginx和php已经运行了,但是机器系统上并没有运行.记录一次nginx报错,操作步骤看下代码: [root@localhost nginx]# systemc ...
- Java并发包源码学习系列:阻塞队列实现之PriorityBlockingQueue源码解析
目录 PriorityBlockingQueue概述 类图结构及重要字段 什么是二叉堆 堆的基本操作 向上调整void up(int u) 向下调整void down(int u) 构造器 扩容方法t ...
- MySQL调优用户监控之show processlist
简介 show processlist显示这台MySQL正在连接的用户: mysql> show processlist; +----+------+-----------+-------+-- ...
- 现有以下关系型数据库中的表(见表4-20表4-21和表4-22),要求将具转换为适合Hbase存储的表并插入数据。
① createTable(String tableName, String[] fields) 创建表,参数tableName为表的名称,字符串数组fields为存储记录各个域名称的数组.要 求当H ...
- Python中,单引号,双引号,三引号的使用区别与原因
先说1双引号与3个双引号的区别,双引号所表示的字符串通常要写成一行如:s1 = "hello,world"如果要写成多行,那么就要使用/ ("连行符")吧,如s ...
- LOJ10066
LOJ10066 新的开始 题目描述 发展采矿业当然首先得有矿井,小 F 花了上次探险获得的千分之一的财富请人在岛上挖了 n 口矿井,但他似乎忘记考虑的矿井供电问题-- 为了保证电力的供应,小 F 想 ...
- hashCode、equals详解
hash和hash表是什么? hash是一个函数,该函数中的实现就是一种算法,就是通过一系列的算法来得到一个hash值,这个时候,我们就需要知道另一个东西,hash表,通过hash算法得到的hash值 ...
- 【wp】HWS计划2021硬件安全冬令营线上选拔赛
逆向手在夹缝中艰难求生系列. 这篇真的存粹是做题笔记了,对内核驱动啥的不太懂,pwn也不会,能做出来的题都是硬逆出来的( childre最后死活没整出来,后来看大佬的wp才知道对子进程有修改(.)呜呜 ...
- Java面试题及解析
面试题 解析 1 2 3 Join Sleep-线程睡眠 Yiedld-线程让步 sleep与yield方法区别 isAlive 终止线程 面试题 1.下列单词属于java访问修饰符的有(A,B, C ...
- Kubernetes --(k8s)yml 文件
认识yml文件 yaml文件语法 大小写敏感 使用缩进表示层级关系 缩进时不允许使用Tab键,只允许使用空格. 缩进的空格数目不重要,只要相同层级的元素左侧对齐即可 # 表示注释,从这个字符一直到行尾 ...