<!-- Inspired by: https://try.alexa.com/marketing-stack/seo-tools/ and https://stratus.hr/
With help from https://24ways.org/2010/intro-to-css-3d-transforms/-->
<div class="container">
<div class="row flip-boxes">
<div class="col-md-3 col-sm-4 col-8 flip-box">
<div class="front" style="background-image: url(https://images.pexels.com/photos/39811/pexels-photo-39811.jpeg?auto=compress&cs=tinysrgb&h=350);">
<div class="content text-center">
First<br>
<span class="click-for-more">
</span>
</div>
</div>
<div class="back">
<div class="content">
First Back
</div>
</div>
</div>
<div class="col-md-3 col-sm-4 col-6 flip-box">
<div class="front" style="background-image: url(https://thumbs.dreamstime.com/b/countryside-landscape-hillside-beautiful-scenic-view-river-rural-fields-summer-season-89540702.jpg);">
<div class="content" >
Second
</div>
</div>
<div class="back">
<div class="content">
Second Back
</div>
</div>
</div>
<div class="col-md-3 col-sm-4 col-6 flip-box">
<div class="front" style="background-image: url(https://llandscapes-ee1.kxcdn.com/wp-content/uploads/2017/09/33945202050_48027b6b38_z.jpg);">
<div class="content">
Third
</div>
</div>
<div class="back">
<div class="content">
Third Back
</div>
</div>
</div>
</div>
</div>
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.flip-boxes {
justify-content: center;
}
.flip-box {
display: flex;
align-content: stretch;
min-height: 200px;
flex-wrap: wrap;
position: relative;
border: 10px solid transparent;
padding:0;
border-top: 0;
-webkit-perspective: 1000;
perspective: 1000;
&:hover {
.back {
transform: rotateY(0deg);
z-index: 10;
}
.front {
transform: rotateY(180deg);
z-index: -1;
}
}
.back, .front {
position: relative;
background-color: #1b2d61;
color: white;
display: flex;
justify-content: center;
align-content: center;
flex: 0 0 100%;
-webkit-transition: all 1s cubic-bezier(.5,1,.5,1);
transition: all 1s cubic-bezier(.5,1.3,.5,1.3);
transform-style: preserve-3d;
background-size: cover;
background-position: center;
}
.back {
background-color: #cecece;
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 100%;
z-index: -1;
transform: rotateY(-180deg);
&:after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 30px;
height: 30px;
border: 15px solid transparent;
border-bottom-color: white;
border-left-color: white;
}
}
.front {
z-index: 10;
.content {
font-size: 2rem;
}
&:after {
content: "";
position: absolute;
bottom: 0;
right: 0;
width: 30px;
height: 30px;
border: 15px solid #cecece;
border-bottom-color: white;
border-right-color: white;
}
}
.content {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
-webkit-transform: translateZ(50px);
transform: translateZ(50px);
text-shadow: 0px 0px 2px black;
}
}
View Compiled
This Pen doesn't use any external JavaScript resources.