CSS3 Flip animation with image and text
by Juan Muñoz
HTML
<div class="wrapper">
<div class="front anim">
<img src="https://www.tytspa.com/imagenes/2conta.png" alt="">
</div>
<div class="back anim">
<span class='azul' style='color:white;'>Ver Más</span>
</div>
</div>
CSS
.wrapper {
width: 100px;
height: 30vh;
}
.anim {
width: 100%;
height: 100%;
-o-transition: all .5s;
-ms-transition: all .5s;
-moz-transition: all .5s;
-webkit-transition: all .5s;
transition: all .5s;
-webkit-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
top: 0px;
left: 0px;
}
img{
width:300px;
}
.front {
z-index: 2;
background: url(https://www.tytspa.com/imagenes/2conta.png) no-repeat;
}
.back {
z-index: 1;
-webkit-transform: rotateX(-180deg);
-ms-transform: rotateX(-180deg);
-moz-transform: rotateX(-180deg);
transform: rotateX(-180deg);
background: url(http://placehold.it/300x300) no-repeat;
}
.wrapper:hover .front {
z-index: 1;
-webkit-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
transform: rotateX(180deg);
}
.wrapper:hover .back {
z-index: 2;
-webkit-transform: rotateX(0deg);
-ms-transform: rotateX(0deg);
-moz-transform: rotateX(0deg);
transform: rotateX(0deg);
}