移动端 第十章 过渡

  • transition:过渡

  • 过渡时间
    transition-duration: 3s;
    过渡属性(定义宽还是高)
    transition-property: all;
    过渡函数(运动的方式)
    transition-timing-function: ease;
    过渡延迟时间
    transition-delay: 4s;

    运动方式(贝塞尔曲线)
    ease:开始和结束慢 中间快 相当于cubic-bezier(0.25, 0.1, 0.25,1)
    ease-in:(加速) 开始慢 相当于cubic-bezier(0.42, 0, 1, 1)
    ease-in-out:先加速后减速 cubic-bezier(0.42, 0, 0.58, 1)
    ease-out:(减速) 结束慢cubic-bezier(0.42, 0, 1, 1)
    linear:匀速 相当于cubic-bezier(0, 0, 0.58, 1)

    -webkit-transition: 2s width;
    safari浏览器需要加前缀,-webkit- ,其他浏览器不需要添加

    transition: 2s width, 4s height, 1s background-color;

    transition: 2s width, 2s 2s height, 1s 4s background-color;
    transition: 3s 2s width, 4s 2s height, 8s 4s background-color;
    过渡: 时间 延迟时间 样式 方式

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			div{
				width: 100px;
				height: 100px;
				background: red;
				/*过渡时间*/
				transition-duration: 1s;
				/*运动方式*/
				transition-timing-function: ease-in-out;
				/*延迟时间*/
				transition-delay: 2s;
				/*过渡属性*/
				transition-property: width;
			}
			div:hover{
				width: 1900px;
			}
		</style>
	</head>
	<body>
		<div></div>
	</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值