<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>过渡</title>
<style>html
/*过渡,可使一个属性的值通过一段时间变成另外一个值*/函数
.box1 , .box3{
width: 100px;
height: 100px;
background-color: #f00;
position: absolute;
left: 0;
/*
过渡相关的属性:
transition-property
要进行过渡的属性 能够同时指定多个值,多个值之间使用, 隔开
all 表示全部的属性都会进行过渡
transition-duration
过渡持续的时间
单位
s 秒
ms 毫秒
1秒 = 1000毫秒htm
transition-delay
过渡的延时it
transition-timing-function
指定过渡的时间函数
ease 默认值 起步慢,而后加速,而后减速中止
linear 匀速运动
ease-in 加速运动
ease-out 减速运动
ease-in-out 先加速后减速io
*/
/*transition: all 2s;*/function
/*transition-property: height , width , background-color;*/
/*!*transition-property: all;*!*/
/*transition-duration: 500ms, 2s, 4s;*/class
/*transition-delay: 1s;*/meta
/*transition-property: left;*/
/*transition-duration: 2s;*/
/*!*transition-timing-function: ease-in-out;*!*/
/*transition-timing-function: steps(6,end);*/
/*transition-timing-function: steps(6,start);*/transition
/*transition 简写属性能够同时设置全部的过渡的样式*/
transition:steps(6,end) 2s 2s left;im
}
.box3{
top: 150px;
background-color: #ff0;
transition-timing-function: steps(6,end);
}
.box2:hover .box1,
.box2:hover .box3{
/*width: 200px;*/
/*height: 200px;*/
/*background-color: #ff0;*/
left: 800px;
}
.box2{
height: 400px;
background-color: #bfa;
position: relative;
}
</style>
</head>
<body>
<div class="box2">
<div class="box1">
</div>
<div class="box3">
</div>
</div>
</body></html>