<img src="https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png" class="levitation" alt="image">

<a href="https://community.codenewbie.org/mgeraud/css-tip-how-to-make-you-img-levitate-213o">Original article</a>
.levitation {
  width: 20%;
  transform: rotate(15deg);
  filter: drop-shadow(22px -15px 5px rgba(0, 0, 0, 0.5));
  animation: bouge 8s infinite alternate-reverse;
}

@keyframes bouge {
  /*starting point and angle (same angle as choosen into .levitation)*/
  from {
    transform: translateY(0px) rotate(15deg);
  }
  /* ending point and angle */
  to {
    transform: translateY(50px) rotate(30deg);
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.