scale等比缩放才能做到看上去能让线条以中心点展开
2016-07-13 16:50
405 查看
.nav-menu>ul>li>a::before {
background: #333 none repeat scroll 0 0;
bottom: -2px;
content: "";
height: 2px;
position: absolute;//注意a一定得是relation相对定位才行,::before可以看做是a的子元素,a是父元素
left:-1px;//适当的调整一下子元素::before和父元素a的对齐距离
width: 100%;//这一点很重要,宽度100%就能继承a的宽度,否则怎么设置都会很突兀
-webkit-transform:scale(0);
transform:scale(0);
-webkit-transition:all .5s ease 0s;
transition:all .6s ease 0s;
}
.nav-menu>ul>li>a:hover::before{//a滑过时::before伪类的效果
// animation:underline1 0.5s ease 0s normal forwords 1 runing ;//forwords让动画停留在最后的状态 后面的1是指只循环一次
// background: #333 none repeat scroll 0 0;
// bottom: -2px;
// content: "";
// height: 2px;
// position: absolute;
transform:scale(1);//只用这一句就够了
}
background: #333 none repeat scroll 0 0;
bottom: -2px;
content: "";
height: 2px;
position: absolute;//注意a一定得是relation相对定位才行,::before可以看做是a的子元素,a是父元素
left:-1px;//适当的调整一下子元素::before和父元素a的对齐距离
width: 100%;//这一点很重要,宽度100%就能继承a的宽度,否则怎么设置都会很突兀
-webkit-transform:scale(0);
transform:scale(0);
-webkit-transition:all .5s ease 0s;
transition:all .6s ease 0s;
}
.nav-menu>ul>li>a:hover::before{//a滑过时::before伪类的效果
// animation:underline1 0.5s ease 0s normal forwords 1 runing ;//forwords让动画停留在最后的状态 后面的1是指只循环一次
// background: #333 none repeat scroll 0 0;
// bottom: -2px;
// content: "";
// height: 2px;
// position: absolute;
transform:scale(1);//只用这一句就够了
}
相关文章推荐
- Struts2的简单使用(二)页面向action传值
- ui组件——多选下拉input的实现(带有搜索功能)
- ui组件——多选下拉input的实现(带有搜索功能)
- 详解Android中使用OkHttp发送HTTP的post请求的方法
- 精确监听AbsListView滚动至底部
- 【终端快捷键】Linux terminal 终端常用快捷键
- PopUpWindow使用详解(一)——基本使用
- 2016.7.13 夏令营 Day6
- jboss-5.1.0.GA-jdk6.zip与jboss-5.1.0.GA.zip有什么区别?以及下载地址!!!
- Jedis使用总结【pipeline】【分布式的id生成器】【分布式锁【watch】【multi】】【redis分布式】
- HDU1258 Sum It Up(DFS)
- drop、delete和truncate三者的区别
- Codeforces Round #343 (Div. 2) C. Famil Door and Brackets(简单dp)
- Json实体类快速生成插件 GsonFormat
- wait()、notify()和notifyAll()是 Object类 中的方法
- c#初学-多线程中lock用法的经典实例
- 易付宝
- S3C2440与SDRAM分析
- Java克隆调用super.clone()原理
- HTML5进阶段内联标签汇总(小篇)