下划线 动画

<ul class="ddd">
<li class="solid active">啦啦啦啦</li>
<li class="solid">我哦我我</li>
<li class="solid">哦哦哦哦</li>
<li class="solid">噢噢噢噢</li>
<li class="solid">雅黑雅黑</li>
</ul>

使用伪类 css

<style>
.solid {
margin-top: 200px;
margin-left: 100px;
text-align: center;
width: 100px;
height: 50px;
position: relative;
float: left;

}
.solid:after {
content: ‘‘;
position: absolute;
left: 50%;
bottom: 15px;
margin-left: 0%;
width: 0%;
height: 2px;
background-color: #FF3401;
transition: all 0.3s ease-in-out;
}
.solid:hover:after {
width: 100%;
margin-left: -50%;
background-color: #FF3401;

}
.solid.active:after,
.solid:hover:after {
width: 100%;
margin-left: -50%;
}
.solid.active.dis:after{
width: 0%;
margin-left: 0%;
}
</style>

初始化 第一个

<script>

$(".ddd .solid").hover( function(event){

$(".solid.active").addClass(‘dis‘);

}, function(event){

$(".solid.active").removeClass(‘dis‘);

} );

</script>

时间: 2024-08-11 03:37:12

下划线 动画的相关文章

CSS3制作hover下划线动画

1.前几天看到Hexo的next主题标题hover效果很炫,自己尝试写了一个,另一个是next的实现,照例先上图 2.实现小黑科技 <div> <a href="javascript:void(0);" class="demo1">自己实现的hover效果</a> </div> .demo1{ position: relative; text-decoration: none; font-size: 20px; col

CSS制作hover下划线动画

.demo1{ position: relative; text-decoration: none; font-size: 20px; color: #333; } .demo1:before{ content: ""; position: absolute; left: 50%; bottom: -2px; width: 0; height: 2px; background: #4285f4; transition: all .3s; } .demo1:hover:before{ w

下划线css

/* <div class="text">header</div> */ .text { /* 作用元素 */ display: inline-block; position: relative; padding: 10px 0; } .text:after { /* 下划线伪元素 */ display: block; content: ''; /* 控制下划线动画起始位置 */ position: absolute; left: 0; right: 0; ma

【界面优化】使用viewpagerindicator添加下划线滑动动画

开源代码viewpagerindicator里面没有实现tab下划线切换过程中的移动动画,都是很突兀的多个fragement之间的切换,导致用户体验略差,google了下相关问题,发现一片博文: http://blog.csdn.net/lancees/article/details/9164421 重点是如下代码: public class UnderlinePageIndicatorEx extends UnderlinePageIndicator{ public UnderlinePage

下划线hover下动态出现技巧

酷炫的动画效果往往更能吸引眼球,下面我将分享纯CSS中,hover的时候出现下划线动态飞入的技巧. 1.下划线从左侧飞入: div::before{ content:""; width:50px; position:absolute; display:inline-block; border-bottom:1px solid red; bottom:0; left:-100px:} div:hover::before{ left:0; transition:all linear 1s;

转帖 利用伪元素和css3实现鼠标移入下划线向两边展开效果

原帖地址   https://www.cnblogs.com/yangjunfei/p/6739683.html 感谢分享 一.思路: 将伪元素:before和:after定位到元素底部中间,设置宽度从0变成100%达到目的. 二.实现: 1.首先定义一个块状元素(行内元素没有宽高)并修改样式为一个背景色为浅灰色的矩形,设置相对定位. html代码 <div id="underline"></div> css样式 #underline{ width: 200px

字体的下划线

NSString * sit= @"忘记密码"; NSMutableAttributedString *sti =[[NSMutableAttributedString alloc]initWithString:sit]; //设置背景颜色以及下划线 NSDictionary * dict1 = @{//字体颜色 NSForegroundColorAttributeName:[UIColor colorWithRed:33/255.0 green:125/255.0 blue:192/

Python下划线的使用

References: [1]. http://python.jobbole.com/81129/ 本文将讨论Python中下划线(_)字符的使用方法.我们将会看到,正如Python中的很多事情,下划线的不同用法大多数(并非所有)只是常用惯例而已. 单下划线(_) 通常情况下,会在以下3种场景中使用: 1.在解释器中:在这种情况下,“_”代表交互式解释器会话中上一条执行的语句的结果.这种用法首先被标准CPython解释器采用,然后其他类型的解释器也先后采用. Python 1 2 3 4 5 6

ie6下 gif动画不动

ie6下 gif动画不动 如果有onclick事件:在IE6中,点击a标签,onclick事件会先执行,其次是href下的动作,href执行后,默认会执行跳转动作(尽管href属性不一定是一个地址),于是页面中的加载就停止了,gif图片就停止播放了.这个应该是IE6底层机制的bug.解决办法:就是在onclick事件后加上return false,这时href就不会被执行.古怪的问题也就搞定了. 如果没有onclick事件,在浏览器里单独浏览图片仍然不动,很有可能是浏览器的设置问题:工具--in