过渡
进度条案例
<style>
.bar{
width: 150px;
height: 15px;
border: 1px solid green;
border-radius: 7px;
}
.bar_in{
width: 50%;
height: 100%;
background-color: green;
transition: all .7s;
}
.bar:hover .bar_in{
width: 100%;
}
</style>
<body>
<div class="bar">
<div class="bar_in">
</div>
</div>
</body>
图像过渡
<style>
*{
margin: 0px;
padding: 0px;
}
.hezi{
width: 100px;
height: 100px;
/* margin-top: 200px;
margin-left: 100px; */
overflow: hidden;
/* background-color:green; */
border-radius: 35px;
}
.name2{
width: 100px;
height: 100px;
transition:900ms;
}
.name4{
width: 100px;
height: 100px;
border-radius: 35px;
}
.hezi:hover div{
transform: translateY(-100%);
}
</style>
<body>
<div class="hezi">
<div class="name1">
<img src="../作业/小米1.png" alt="" class="name2">
</div>
<div class="name3">
<img src="../作业/小米2.png" alt="" class="name4">
</div>
</div>
</body>
当鼠标经过时