<div class="container">
<div class="card">
<div class="front">HOVER ME</div>
<div class="back">This is the back face.</div>
</div>
</div>
body {
color: #555;
font-size: 1.1em;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
hr {
margin: 50px 0;
}
.container {
margin: 40px auto;
width: 300px;
border: 1px solid #eee;
-webkit-perspective: 800px;
perspective: 800px;
}
.card {
-webkit-transition: all .3s ease-out;
transition: all .3s ease-out;
width: 300px;
height: 500px;
position: relative;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.container:hover .card {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.front,
.back {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
width: 300px;
height: 500px;
text-align: center;
color: white;
line-height: 500px;
font-weight: bold;
}
.front {
background-color: maroon;
z-index: 2;
}
.back {
z-index: 1;
background-color: #7f8c8d;
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}