JSFiddle - React, Tailwind, and code Playground
by philfreo
HTML
<div id="container">
<div id="card" class="shadow">
<div class="front face">
<img src="http://css3.bradshawenterprises.com/images/Stones.jpg"/>
</div>
<div class="back face center">
<p>This is nice for exposing more information about an image.</p>
<p>Any content can go here.</p>
</div>
</div>
</div>
CSS
#container {
position: relative;
margin: 10px auto;
width: 450px;
-webkit-perspective: 1000;
}
#card {
width: 100%;
-webkit-transform-style: preserve-3d;
-webkit-transition: all 1.0s linear;
}
#container:hover #card {
-webkit-transform: rotateY(180deg);
}
.face {
position: absolute;
width: 100%;
-webkit-backface-visibility: hidden;
}
.face.back {
display: block;
-webkit-transform: rotateY(180deg);
box-sizing: border-box;
padding: 60px;
color: white;
background-color: #aaa;
}