HTML——CSS动画效果

过渡效果:

1、transition-property 设置过渡的属性,比如:width height background-color
2、transition-duration 设置过渡的时间,比如:1s 500ms
3、transition-timing-function 设置过渡的运动方式,常用有 linear(匀速)|ease(缓冲运动)
4、transition-delay 设置动画的延迟
5、transition: property duration timing-function delay 同时设置四个属性

<style type="text/css">
			.show {
				width: 200px;
				height: 200px;
				background: saddlebrown;
			}
			.show:hover {
				width: 400px;
				height: 400px;
				background: blueviolet;
			}
		</style>

这是没有过渡效果之前的

<style type="text/css">
			.show {
				width: 200px;
				height: 200px;
				background: saddlebrown;
                transition: all 2s;
			}
			.show:hover {
				width: 400px;
				height: 400px;
				background: blueviolet;
			}
		</style>

这是加了过渡效果之后的效果,所有效果延迟0.5s

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值