My idea is to combine the box-shadow property and the transform property. Then we set 4 cards and different displacements according to the situation.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<style type="text/css">
.card {
padding: 10px;
width: 300px;
height: 180px;
background-color: #FFF;
border: none;
border-radius: 6px;
-webkit-transition: all 250ms cubic-bezier(0.02, 0.01, 0.47, 1);
transition: all 250ms cubic-bezier(.02, .01, .47, 1);
}
.card:hover {
box-shadow: 0 16px 32px 0 rgba(48, 55, 66, 0.15);
transform: translate(0,-100px);
transition-delay: 0s !important;
}
.box-shadow {
-webkit-box-shadow: 0 0.25rem 1rem rgba(48, 55, 66, 0.15);
box-shadow: 0 4px 16px rgba(48, 55, 66, 0.15);
}
.card-header {
text-align: center;
}
.card-body, .card-footer {
text-align: left;
}
</style>
<body style="background: #e3e3e3;">
<div class="card box-shadow">
<div class="card-header">
<p>This is a card</p>
</div>
</div>
</body>
</html>
Best Regards
Qi You