I have been working on my portfolio and have incorporated flipping cards to showcase my android apps. When someone hovers over the cards, they flip and zoom in to display a brief description.
The issue I am facing is that the lower cards are overlapping the ones above them when hovered over. I have tried using z-index but without success.
Here is the CSS code for the cards:
/* Card */
.card-wrapper {
-webkit-perspective: 1000;
-moz-perspective: 1000;
perspective: 1000;
border: 1px solid #ccc;
margin: 50px;
display: inline-block;
visibility:hidden;
width:400px;
height:540px;
z-index: 2;
}
.card-wrapper:hover .flipper, .card-wrapper.hover .flipper {
-webkit-transform: rotateY(180deg) scale(1.5,1.5) translate(10%, 10%);
-moz-transform: rotateY(180deg) scale(2,2);
transform: rotateY(180deg) scale(2,2);
position: relative;
}
.card-wrapper, .front, .back {
}
.flipper {
-webkit-transition: 0.6s;
-webkit-transform-style: preserve-3d;
-moz-transition: 0.6s;
-moz-transform-style: preserve-3d;
transition: 0.6s;
transform-style: preserve-3d;
background-color:#ffffff;
height:540px;
position: relative;
z-index: 2;
}
.front, .back {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
visibility:visible;
position: absolute;
top: 0;
left: 0;
}
.front {
z-index: 2;
}
.back {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
transform: rotateY(180deg);
z-index: 200000000000000000;
}
And here is the HTML:
<div class="card-wrapper" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">
<div class="front">
<!-- front content -->
<div class="card">
<img src="images/wakey-feature.png" alt="Wakey" width="400px" height="450px">
<h2 class="app-title">Wakey</h2>
</div>
</div>
<div class="back">
<!-- back content -->
<div class="card">
</div>
</div>
</div>
<div class="play-store-card">
<a href="https://play.google.com/store/apps/details?id=com.doublep.wakey" target="_blank">
<div class="dashed-line">
<button class="play-store-button" type="button" style="margin: 0px 0px 0px 0px;">
<img src="images/play-store.png">
</button>
</div>
</a>
</div>
</div>
How can I go about fixing this problem?