css3动画集合

1.div由短变长

​
.red_banner_line{
	width: 20px;height: 4px;background: #EA0000;float: right;
	transition:width .5s;float: right;
	-moz-transition:width .5s; /* Firefox 4 */
	-webkit-transition:width .5s; /* Safari and Chrome */
	-o-transition:width .5s; /* Opera */
}
.lunbo_list_this .red_banner_line{padding-left:40px;width: 100%;}
//设置宽度

​

2.利用伪类画下划线

.menubar_cont .top_bar{
	float: left;font-size: 20px;color: #793f26;padding: 10px 0px;margin: 0px 35px;cursor: pointer;
	position: relative;transition: all .3s;
    -webkit-transition: all .3s;
}
.top_bar:after{
	content: "";
    width: 0;
 	height:4px;
 	background:#EA0000;
 	position: absolute;
 	top: calc(100% - 4px);
 	left: 0%;
 	transition: all .2s;
    -webkit-transition: all .2s;
}
 
.top_bar:hover:after{
    left: 0%;
    width: 100%;
}
.top_bar_cont:after{ 
    content: '';
    top: auto;
    bottom: 0;
    width: 100%;
}

3.图片缩放

.six_cont img{
	-webkit-transform: scale(1,1);
	-moz-transform: scale(1,1);
	transform: scale(1,1);
	transition: all 0.3s;
	-moz-transition: all 0.3s;
	-webkit-transition: all 0.3s;
}
.six_cont:hover img{
	-webkit-transform: scale(1.1,1.1);
	-moz-transform: scale(1.1,1.1);
	transform: scale(1.1,1.1);
	 
}

4.div位置移动

.six_cont_txt{
	float: left;width: 100%;text-align: center;position: absolute;bottom: -40px;
	transition: all 0.5s;
	-moz-transition: all 0.5s;
	-webkit-transition: all 0.5s;
}
.six_cont:hover .six_cont_txt{
	bottom: 20px;
}

5.旋转

transform:rotate(180deg);

 

6.声明一个函数动画

.footer_center ul li a:hover .fmenu_line{
	position:relative;
	animation:myfooterwidth 0.5s infinite;
	-webkit-animation:myfooterwidth 0.5s infinite; /*Safari and Chrome*/
	animation-iteration-count:1;/*动画只执行一次*/
	-webkit-animation-iteration-count:1;
}

@keyframes myfooterwidth
{
	from {width:0px;}
	to {width:20px;}
}

@-webkit-keyframes myfooterwidth  
{
	from {width:0px;}
	to {width:20px;}
}

后期更新中,不断学习

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值