I've been playing around with CSS perspective to create a 3D card flip effect, but I'm running into an issue where the right-most cards are overlapping incorrectly when they flip. I've tried using Z-Index (knowing that it requires a positioning other than "static"), but it doesn't seem to be working. Any assistance would be greatly appreciated. You can find the project on CodePen at the following link:
https://codepen.io/mikrayall/pen/WNzBxEw
Here is the HTML code snippet:
<div class="card">
<div id="cardContents" class="cardContents1">
<div class="cardFront"><h2>A</h2></div>
<div class="cardBack"><p>Once there was a dog...</p></div>
</div>
</div>
...
</div>
Below is the CSS code snippet:
/* CSS code here */
I have already tried applying Z-Index to elements like .cardBack, .cardFront, and .cardContents, but the issue persists. Any guidance or solutions would be highly valued. Thank you.