- 效果图:
- xxx.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>15.鼠标经过显示阴影.html</title>
<style>
div{
width: 150px;
height: 200px;
border: 1px solid #ccc;
margin: 100px auto;
transition: all 0.6s;
}
div:hover{
box-shadow: 0 10px 20px rgba(0,0,0,0.5);
transform: translateY(-20px);
}
</style>
</head>
<body>
<div></div>
</body>
</html>