<div class="flip-container">
<div class="card">
<div class="front">
</div>
<div class="back">
</div>
</div>
</div>
body {
background: #fcd443;
}
.flip-container {
position: absolute;
left: 50%;
top: 50%;
margin-top: -240px;
margin-left: -320px;
perspective:1200;
}
.flip-container:hover .card {
transform:rotateY(-180deg);
}
.card {
width: 640px;
height: 480px;
transition:all 1.2s;
transform-style:preserve-3d;
}
.front, .back {
width: 640px;
height: 480px;
position: absolute;
top: 0px;
left: 0px;
backface-visibility:hidden;
}
.front {
background: url('https://res.cloudinary.com/highflyer910/image/upload/v1565192990/es_reyvem.png');
background-color: #323c6b;
background-size: cover;
z-index: 1;
}
.back {
background: url('https://res.cloudinary.com/highflyer910/image/upload/v1565192990/a5jluq_unabhl.png');
background-size: cover;
background-color: #323c6b;
z-index: 2;
transform: rotateY(-180deg);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.