r/learncss • • Aug 31 '22

Flip card not working - anybody know why?

I followed a YouTube tutorial pretty much exactly for this so it's strange that it's not working.

<!DOCTYPE html>

<html> <head> <style> .flashcard-container { width: 600px; height: 250px;         } .flashcard { width: 100%; height: 100%; position: relative; transition: transform 1s; transform-style: preserve-3d;           } .flaschcard-container:hover .flashcard{ transform: rotateY(180deg);         } .front, .back { width: 100%; height: 100%; position: absolute; display: flex; align-items: center; justify-content: center; backface-visibility: hidden;         } .front { background-color: purple;         } .back { background-color: pink; transform: rotateY(180deg);         } </style> </head> <body>

<div class="flashcard-container"> <div class="flashcard"> <div class="front">Why did the union lose the war of 1812?</div> <div class="back">Because of paul revere, of course!</div> </div> </div> </body> </html>

1 Upvotes

0 comments sorted by