<html>
  <body>
    <div class="box">
    </div>
    <div class="secondBox">
    </div>
  </body>
</html>
html, body {
  width: 100%;
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10%;
}

.box, .secondBox {
  border-radius: 5px;
  width: 200px;
  height: 200px;
  background-size: cover;
  background-image: url("https://images.unsplash.com/photo-1675946729462-f82faa327f77?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=735&q=80");
  transition: 0.4s;
}

.box:hover {
  margin-bottom: 20px;
  box-shadow: 20px 20px #ff006e;
}

.secondBox {
  background-image: url("https://images.unsplash.com/photo-1676979382991-aa4748943525?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=387&q=80");
}

.secondBox:hover {
  box-shadow: 5px 5px 10px;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.