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)& ...
随机推荐
- 从零开始学spring源码之ioc预热:bean的拓展和beanProcessor注册
上篇聊完了bean的解析,说起来做的事情很简单,把xml文件里面配置的标签全部解析到spring容器里面,但是spring做的时候,花了那么大代价去做,后面看看到底值不值得呢. 接下来看看prepar ...
- error Unexpected use of comma operator no-sequences解决过程
error Unexpected use of comma operator no-sequences解决过程 报错内容: ERROR in ./pages/course/_id.vue friend ...
- 用git合并分支时,如何保持某些文件不被合并
用git合并分支时,如何保持某些文件不被合并_fkaking的专栏-CSDN博客_git 合并分支 https://blog.csdn.net/fkaking/article/details/4495 ...
- ProbabilityStatistics
class ProbabilityStatistics: @staticmethoddef simulation_of_probability(v, ratio=10000): assert v &g ...
- 6到8个月如何达到三年加得前端经验,对标P7,“慕课网 Java工程师2020”
百度网盘链接:https://pan.baidu.com/s/1xshLRO3ru0LAsQQ0pE67Qg 提取码:bh9f 阶段一:课程设计及前端创建脚手架开发 第1周 需求分析和架构设计 ...
- Spring听课笔记(专题二)
第3章 Spring Bean的装配(上) 3-1:配置项及作用域 1.Bean的配置项: -- Id -- Class (这个必须,其他的都可以不配置) -- Scope (作用域) -- Cons ...
- java线程缓存刷新的疑问
https://www.jianshu.com/p/3c06ffbf0d52 import java.util.concurrent.TimeUnit; public class VolatileFo ...
- 404 GET /nbextensions/jupyter-js-widgets/extension.js
数据科学交流群,群号:189158789,欢迎各位对数据科学感兴趣的小伙伴的加入! 解决办法: 首先要确定你安装和配置nbextensions时有没有加--user,如果当时没加这里就不用加,否则不一 ...
- Go语言学习笔记(4)——并发编程
Golang在语言级别支持了协程,由runtime进行管理. 在Golang中并发执行某个函数非常简单: func Add(x, y int) { fmt.Println(x + y) } func ...
- GeoMesa Spark
GeoMesa Spark 一.Spark JTS 1.1 示例 1.2配置 1.3 地理空间用户定义的类型和功能 1.4 geojson输出 1.5 Building 二.Spark Core 2. ...