官方效果:
鼠标放在图标上会同时使该盒子向上移动3px,并且有右下左的阴影
案例模仿效果:
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div {
margin: 0px auto;
width: 300px;
height: 400px;
background-color: pink;
/* 谁做过度给谁加transition (谁变化了就给谁添加过度属性)*/
/* 最终我们实际操作是 */
transition: all .3s;
}
/* transition: 要过渡的属性 花费时间 运动曲线 何时开始; */
div:hover {
margin-top: -3px;
box-shadow: 0 15px 30px rgba(0, 0, 0, .3);
}
</style>
</head>
<body>
<div></div>
</body>
</html>