Currently working on my own card design using Bootstrap v4, specifically utilizing rows and columns. Encountering an issue when attempting to stack the two sides of the card on top of each other. I have tried using position: absolute;
but they disappear completely.
.thecard {
perspective: 150rem;
-moz-perspective: 150rem;
position: relative;
}
.thecard__side {
background-color: orangered;
color: #fff;
font-size: 2rem;
height: 50rem;
transition: all .8s;
position: absolute;
top: 0;
left: 0;
width: 100%;
backface-visibility: hidden;
}
.thecard__side--front {
background-color: orangered;
}
.thecard__side--back {
background-color: green;
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.thecard:hover .thecard__side--front {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.thecard:hover .thecard__side--back {
-webkit-transform: rotateY(0);
transform: rotateY(0);
}
<div class="row mt-5">
<div class="mt-5 mt-lg-0 col-md-6 col-lg-4">
<div class="thecard">
<div class="thecard__side thecard__side--front">
Front
</div>
<div class="thecard__side thecard__side--back">
Back
</div>
</div>
</div>
<div class="mt-5 mt-lg-0 col-md-6 col-lg-4">
<div class="thecard">
<div class="thecard__side thecard__side--front">
Front
</div>
<div class="thecard__side thecard__side--back">
Back
</div>
</div>
</div>
<div class=" offset-md-3 mt-5 mt-lg-0 offset-lg-0 col-md-6 col-lg-4">
<div class="thecard">
<div class="thecard__side thecard__side--front">
Front
</div>
<div class="thecard__side thecard__side--back">
Back
</div>
</div>
</div>
</div>
Seeking suggestions for this issue. Any solutions, guys?