<div class="target-container">
   <h1 class="target">回転するよー</h1> </div>

<div class="target-container">
  <img class="target" src="https://netemolonge.net/wp-content/uploads/2019/02/6ac0802b11d98f704bdae7f89e4f905a-e1558708496541.png">
</div>
   
.target {
  transition: 1s;
  transform: rotateX(0deg);
}

.target-container:hover .target {
  transform: rotateX(360deg);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.