实现鼠标移入移出时,盒子缓慢变大变小效果
<!DOCTYPE html>
<html lang="en">
<head>
<title>test</title>
<style>
.box{
width: 200px;
height: 200px;
margin: 20px auto ;
background-color: pink;
/* transition 别放hover里,放到盒子box里,这样移入移出一样缓慢,
不然只对hover移上去有缓慢效果 */
transition: all 1s;
}
.box:hover{
transform: scale(1.1);
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>