Click the card to see the 3D flip animation in action!
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
padding: 50px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.card-container {
perspective: 1000px;
width: 300px;
height: 400px;
}
.card {
position: relative;
width: 100%;
height: 100%;
transform-style: preserve-3d;
transition: transform 0.6s;
cursor: pointer;
}
.card:hover {
transform: rotateY(180deg);
}
.card-face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
display: flex;
align-items: center;
justify-content: center;
text-align: center;
padding: 20px;
box-sizing: border-box;
}
.card-front {
background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
color: white;
}
.card-back {
background: linear-gradient(45deg, #4ecdc4, #45b7d1);
color: white;
transform: rotateY(180deg);
}
.card-content h2 {
margin: 0 0 15px 0;
font-size: 24px;
}
.card-content p {
margin: 0;
line-height: 1.5;
}
</style>
</head>
<body>
<div class="card-container">
<div class="card">
<div class="card-face card-front">
<div class="card-content">
<h2>Front Side</h2>
<p>Hover to flip this card and see the magic happen!</p>
</div>
</div>
<div class="card-face card-back">
<div class="card-content">
<h2>Back Side</h2>
<p>This is the back of the card with different content and styling.</p>
</div>
</div>
</div>
</div>
</body>
</html>