<div class="box"></div>
body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.box {
  width: 300px;
  height: 150px;
  background: red;
  position: relative; 
  &:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: green;
    z-index: -1;
    transition: transform .3s;
  }
  &:hover {
    &:before {
      transform: translate(10px, 10px);
    }
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.