JSFiddle - React, Tailwind, and code Playground

HTML

<div class="test"></div>

CSS

.test
{
    width: 400px;
    height: 300px;
    position: relative;
    border: 1px solid green;
}

.test:before, .test:after {
    content: "";
    position: absolute;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    opacity: 1;
}
.test:before {
    background-image: url(http://placekitten.com/1000/750);
    background-size: cover;
    z-index: 1;
    transition: opacity 2s;
}

.test:after {
    background-image: url(http://placekitten.com/1200/900);
    background-size: cover;
}

.test:hover:before {
    opacity: 0;
}